<html>
<head>
<script type="text/javascript">
function myNewXMLobject(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp=false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp=false;
}
}
return xmlhttp;
}
xmlobject=myNewXMLobject();
function up()
{xmlobject.open("GET", "test.php",true);
xmlobject.onreadystatechange=function() {
if (xmlobject.readyState==4) {
document.getElementById('T1').innerHTML=xmlobject.responseText;
alert(xmlobject.responseText)
}
}
xmlobject.send(null)
}
</script>
</head>
<body onload="up();">
<div id="T1" style="border:1px solid black;height:100;width:150"></div>
</body>
</html>
Bookmarks