易截截图软件、单文件、免安装、纯绿色、仅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.
如果


相关问答:

Visual Web Developer 2008安装AJAX问题!帮帮忙啊!

请哥哥姐姐弟弟妹妹叔叔阿姨们帮帮忙
我遇见了一个跟您一样的问题,就是我的 Visual Web Developer 2008 简体版 安装AJAX的时候也出现问题,我下载AjaxControlToolkit
了也解压了,但是没有安装AspAjaxExtSetu ......

Ajax无刷新控件

<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1&q ......

ASP+AJAX的问题

VBScript code:

Dim FoundErr,MsgErr
FoundErr = true
username=request.QueryString("userName")
password=request.QueryString("userPwd")
MsgErr = ""
if username = &qu ......

Jquery1.3.2的AJAX问题

HuiFu.aspx页面


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HuiFu.aspx.cs" Inherits="fdfdcs" %>

<!DOCTYPE html PUBLIC &q ......

ajax乱码问题

JScript code:

function createRequest(){
if(window.XMLHttpRequest){
httpRequest=new XMLHttpRequest();
}else if(window.ActiveXObject){
try ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号