htm页面无限刷新!!!!急急
html代码如果:
<html>
<head>
<title></title>
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
}
catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("对不起,您的浏览器不支持XMLHttpRequest对象!");
}
}
}
}
function getvalue(){
createXMLHttpRequest();
var url = "JsHandler.ashx";
xmlHttp.open("POST", url, true)
xmlHttp.onreadystatechange = repeatResult;
xmlHttp.send("");
return false;
}
function repeatResult() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
document.write(xmlHttp.responseText);
}
}
}
</script>
</head>
<body onload="getvalue()" >
</body>
</html>
执行时页面无限刷新,JsHandler.ashx是操作数据库文件,我只想要他加载一次完成,不再刷新 怎么解决???