var xmlhttp;
var xmldom;
function myrequest(){
if(xmlhttp.readyState==4){
	
if(xmlhttp.status==200){
xmldom=xmlhttp.responseText;
/*
xmldom=xmlhttp.responseXML;
var html="";
var root=xmldom.documentElement;
html=root.childNodes(0).childNodes(0).text;
*/
document.getElementById("ip").innerHTML=xmldom;
}
}
}
function mychange(){
if(window.ActiveXObject){
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}else{
alert("ÄãµÄä¯ÀÀÆ÷²»Ö§³ÖXMLHTTP");
}
xmlhttp.open("get","ajax.php",true);
xmlhttp.onreadystatechange=myrequest;
xmlhttp.send(null);
}
 if(window.attachEvent)
 {
 	//IE
	document.body.onload=mychange;
 }
 else if(window.addEventListener)
 {
 	window.addEventListener('load',mychange(),false);
 }