Ajax兼容性基础问题
JScript code:
var xmlHttp;
function creatReq() // 创建xmlhttprequest,ajax开始
{
if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHttp");
}
}
function Work()
{
creatReq();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange = callback;
xmlHttp.send();
}
function callback()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.Status==200)
{
Dispaly();
alert("服务端返回状态" + xmlHttp.Status);
}
else
{
alert("服务端返回状态" + xmlHttp.Status);
}
}
else //请求状态还没有成功,页面等待
{
document .getElementById ("main").innerHTML = "wait";
}
}
function Dispaly() //接受服务端返回的数据,对其进行显示
{
document .getElementById ("main").innerHTML =xmlHttp.responseText;
}
这样触发运行: <body onload="Work();">
问题在此:在IE6中没有问题,
在IE7中。xmlHttp.Status==出现的是undefined.xmlHttp.Status==OK.
如果
相关问答:
<div id="div6" runat="server" style= "height:auto;width:auto; text-align: left;">
& ......
http://localhost:8080/xx/zz.do 显示 out的 xml 数据
xml.open("GET",arguments[0],true);// arguments[0]是 /xx/zz.do
xml.send();
alert(arguments[0]);//这边有
x ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xht ......
现在用的功能相当于选项卡,之前的使用js控制层的现实来识别的,函数如下
JScript code:
function showDiv(id,num)
{ for(i=1;i<=num;i++) {
var currentId="div"+i;
......
VBScript code:
Dim FoundErr,MsgErr
FoundErr = true
username=request.QueryString("userName")
password=request.QueryString("userPwd")
MsgErr = ""
if username = &qu ......