易截截图软件、单文件、免安装、纯绿色、仅160KB

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.
如果


相关问答:

ajax的AsyncPostBackTrigger没效果

            <div id="div6" runat="server" style= "height:auto;width:auto; text-align: left;">
          & ......

ajax 取不到数据

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 ......

ajax问题

<!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 ......

请教ajax加载页面问题?

现在用的功能相当于选项卡,之前的使用js控制层的现实来识别的,函数如下
JScript code:

function showDiv(id,num)
{ for(i=1;i<=num;i++) {
var currentId="div"+i;
......

ASP+AJAX的问题

VBScript code:

Dim FoundErr,MsgErr
FoundErr = true
username=request.QueryString("userName")
password=request.QueryString("userPwd")
MsgErr = ""
if username = &qu ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号