<ht
ML>
<head>
<
;meta http-equiv="Content
-ty
PE" content="text/html"/>
<script language="javascript">
VAR ajax;
function createAjax()
{
if(window.ActiveXObject)
{
try
{
return new ActiveXObject("Ms
XM12.XMLHTTP");
}
catch(e)
{
try
{
return new
ActiveXObject("Microsoft.XMLHTTP");
}
catch(e2)
{
return null;
}
}
}
else if(window.XMLHtt
PRequest)
{
return new XMLHttpRequest();
}
else
{
return null;
}
}
function onRcvData()
{
if(ajax.ready
state
==4)
{
if(ajax.status==200)
{
var content=document.getElementById('content');
content.innerHTML=ajax.responseText;
}
else
{
alert("error");
}
}
}
function ajaxSendRequest(uri)
{
ajax=createAjax();
if(!ajax)
{
alert("no");
return 0;
}
ajax.onreadystatechange=onRcvData;
ajax.open("GET",uri,true);
ajax.send("");
}
</script>
<t
ITle>Hello AJAX</title>
</head>
<body>
<div id="content"></div>
<
br>
<input type="button" value="Hello"
onclick="ajaxSendRequest('http://localhost:8080/
test/hello.jsp')">
</body>
</html>