prototype.jsを使う

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>prototype.jsを使う</title>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript"><!--
function loadTextFile()
{
var filename = "sample.txt?cache="+(new Date()).getTime();
new Ajax.Request(filename, { method: "get", onComplete: displayData });
}
function displayData(httpObj)
{
alert(httpObj.responseText);
}
// --></script>
</head>
<body>
<h1>prototype.jsを使う</h1>
<form>
<input type="button" value="ファイルを読み込み" onClick="loadTextFile()"><br>
</form>
</body>
</html>
・サンプルを実行する
実践Web2.0 Ajax プログラミング入門 説明などは本書を参考にしてください。