ajax谷歌浏览器兼容性问题
如下的代码,在ie浏览器行,在谷歌浏览器不行了,求高人帮帮怎么解决functiongetXMLHttprequest(){varxmlHttp;if(window.Act...
如下的代码,在ie浏览器行,在谷歌浏览器不行了,求高人帮帮怎么解决
function getXMLHttprequest()
{
var xmlHttp;
if(window.ActiveXObject) xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
else if(window.XMLHttpRequest) xmlHttp=new XMLHttpRequest();
return xmlHttp;
}
function ajax()
{
var xmlHttp = getXMLHttprequest();
xmlHttp.open("POST","checkUsername.aspx?username="+username);
xmlHttp.OnReadyStateChange=function(){onReadyStateChange.apply(xmlHttp);}
xmlHttp.send(null);
}
function onReadyStateChange() { } 展开
function getXMLHttprequest()
{
var xmlHttp;
if(window.ActiveXObject) xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
else if(window.XMLHttpRequest) xmlHttp=new XMLHttpRequest();
return xmlHttp;
}
function ajax()
{
var xmlHttp = getXMLHttprequest();
xmlHttp.open("POST","checkUsername.aspx?username="+username);
xmlHttp.OnReadyStateChange=function(){onReadyStateChange.apply(xmlHttp);}
xmlHttp.send(null);
}
function onReadyStateChange() { } 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询