关于Ajax在火狐下不执行的问题?
为什么在火狐浏览器下ajax.readyState==4正常,而ajax.status==200就不执行呢?在IE下可以。
------解决方案--------------------你这个什么包啊
.NET??JAVA??
说的莫名其妙啊...
FIREFOX和IE区别很大的...
JS...CSS...
------解决方案--------------------可以执行的,随便搞个试试
<html>
<head>
<script type= "text/javascript ">
var request;
window.onload = function() {
//request = new XMLHttpRequest();//create for Mozilla, Firefox, Safari, and Netscape
//request = new ActiveXObject( "Microsoft.XMLHTTP ");//create for Internet Explorer
if(window.ActiveXObject){
request=new ActiveXObject( "Msxml2.XMLHTTP ");
if (!request){
request=new ActiveXObject( "Microsoft.XMLHTTP ");
}
}
else if(window.XMLHttpRequest){
request = new XMLHttpRequest();
}
request.onreadystatechange=handleResponse;
request.open( "GET ", "helloworld.jsp ", true);
request.send(null);
}
function handleResponse() {
if(request.readyState == 4){
if(request.status == 200){
var doc = request.responseXML;
var node = document.getElementById( 'output ');
node.innerHTML = doc.documentElement.childNodes[0].nodeValue;
}
}
}
</script>
</head>
<body>
<h2 id= "output "> </h2>
</body>
</html>
是不是你所谓的Ajax没有对Firefox的支持?
------解决方案--------------------希望FIREFOX早点占邻市场, ie 和 Firefox不兼容,写js太烦麻了