<script>
var xmlhttp;
function creatXHR()
{
if(window.ActiveXObject)
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
}
//按钮事件
function doStart()
{
createXHR();
var url = "ajax.jsp";
xmlhttp.open("GET", url);
xmlhttp.onreadystatechange = callback;
xmlhttp.send(null);
}
function callback()
{
if(xmlHttp.readyState==4)
{
if(xmlhttp.status==200)
{
document.getElementById("my").innerHTML = xmlhttp.responseText;
}
}
}
</script>