<html>
<head>
<title></title>
<script type="text/javascript">
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
//alert(xmlhttp.status);//如果此处取消注释,则IE中报“未指定的错误”。Opera和谷歌浏览器不报。
if (xmlhttp.readyState==4 && xmlhttp.status==200) /* 就是这里,Status一直为0 */
{
alert("aa");
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","/Learn/myTest.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="myDiv"></div>
<input type="button" onclick="loadXMLDoc()" value="TEST"/>
</body>
</html>我真不知道什么内幕,求内幕揭秘。
<head>
<title></title>
<script type="text/javascript">
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
//alert(xmlhttp.status);//如果此处取消注释,则IE中报“未指定的错误”。Opera和谷歌浏览器不报。
if (xmlhttp.readyState==4 && xmlhttp.status==200) /* 就是这里,Status一直为0 */
{
alert("aa");
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","/Learn/myTest.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>
<div id="myDiv"></div>
<input type="button" onclick="loadXMLDoc()" value="TEST"/>
</body>
</html>我真不知道什么内幕,求内幕揭秘。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货