`
abiao888
  • 浏览: 6125 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
最近访客 更多访客>>
社区版块
存档分类
最新评论

使用firefox xmlhttprequest同步的时候,无法加载数据

 
阅读更多
使用firefox xmlhttprequest同步的时候,是不会onreadystatechange事件的,但在IE下会触发,到firefox网站上查了下,发现这个方法要这么写
Javascript代码  收藏代码

oXmlHttp.open('GET', url,false); 
    oXmlHttp.send(); 
    if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 ){ 
    IncludeJS( url, sId, oXmlHttp.responseText ); 
    } 
    else{ 
        alert( 'XML request error: ' + oXmlHttp.statusText + ' (' + oXmlHttp.status + ')' ) ; 
    }

它直接跟在send后面,在IE下也是可以的。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics