我用ajax做无刷新页面显示数据 为什么出现的全是代码? 30
functionGetResult(){http_request=false;if(window.XMLHttpRequest){http_request=newXMLH...
function GetResult() {
http_request = false;
if(window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {//设置MiME类别
http_request.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) { // IE浏览器
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
window.alert("不能创建XMLHttpRequest对象实例.");return false;}http_request.open("POST","userInfo.do?action=updateResetMyself",false); http_request.send(); var strResult = http_request.responseText; RemoveRow(); num1 = strResult; row1 = tb.insertRow(); cell1 = row1.insertCell(); cell1.innerText = num1; } function RemoveRow() { var iRows = tb.rows.length; for(var i=0;i<iRows-1;i++) { tb.deleteRow(1); } } function MyShow() { timer = window.setInterval("GetResult()",2000); } 展开
http_request = false;
if(window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {//设置MiME类别
http_request.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) { // IE浏览器
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
window.alert("不能创建XMLHttpRequest对象实例.");return false;}http_request.open("POST","userInfo.do?action=updateResetMyself",false); http_request.send(); var strResult = http_request.responseText; RemoveRow(); num1 = strResult; row1 = tb.insertRow(); cell1 = row1.insertCell(); cell1.innerText = num1; } function RemoveRow() { var iRows = tb.rows.length; for(var i=0;i<iRows-1;i++) { tb.deleteRow(1); } } function MyShow() { timer = window.setInterval("GetResult()",2000); } 展开
2个回答
展开全部
你确定是刷新不是重新输出?
这样的问题应该是输出的时候错误.
这样的问题应该是输出的时候错误.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询