2010-04-15 48 views
0

我尝试使用XMLHttpRequest对象 所以它完全工作在Internet Explorer不错,但Firefox的它不会工作的问题的XMLHttpRequest总是与状态码0返回火狐

一小段代码进行异步调用

if (req.readyState == 4) 
{ 
    if (req.status == 200) //here firefox gives status code always 0 and for IE works fine 
    { 
    //read response    
    } else { 
    alert("There was a problem with the request."); 
    } 
} 

回答

-1

问题已解决,因为对Firefox的误解,状态码为 ,导致将XMLHttpRequest设置为非HTTP请求。 因此,它返回状态代码为0

+3

我有同样的问题。你能解释更多关于答案和解决方法吗? – 2011-08-26 18:35:25