33 lines
958 B
HTML
33 lines
958 B
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<script type="text/javascript">
|
|
function loadXMLDoc()
|
|
{
|
|
var xmlhttp;
|
|
if (window.XMLHttpRequest)
|
|
{// code for IE7+, Firefox, Chrome, Opera, Safari
|
|
xmlhttp=new XMLHttpRequest();
|
|
}
|
|
else
|
|
{// code for IE6, IE5
|
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
xmlhttp.onreadystatechange=function()
|
|
{
|
|
if (xmlhttp.readyState==4 && xmlhttp.status==200)
|
|
{
|
|
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
|
|
}
|
|
}
|
|
xmlhttp.open("GET","http://localhost:52367/test/ajax.txt",true);
|
|
xmlhttp.send();
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1>This is a local file test with js</h1><li><a href="http://localhost:52367/">back to home</a></li><div id="myDiv"><h2>Let AJAX change this text</h2>
|
|
<button type="button" onclick="loadXMLDoc()">Change Content</button>
|
|
</div>
|
|
</body></html>
|