var oInterval="";
function fnStartInterval()//开始刷新
{
//oTimer.innerHTML="Interval Started";
oInterval=window.setInterval("count()",5000); //每5s刷新一次
}
function count()
{
var oHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
oHttpReq.open("POST","refreshHandler.aspx",false);//refreshHandler.aspx为一个没有任何控件的空页面,在其cs文件中写入需要处理的业务逻辑(如从数据库中提取数据)
oHttpReq.send();
var oDoc = new ActiveXObject("MSXML2.DOMDocument");
oDoc.loadXML(oHttpReq.responseText);
var result = oDoc.selectSingleNode("//result").nodeTypedValue;//返回结果应为xml格式
UICurOrientationQuery.tbLocationInfo.value = result;//UICurOrientationQuery为页面中form的名称,tbLocationInfo为要局部刷新的textbox名称
}
希望对lz能有些帮助