因为工作的需要用了一下firefox的xmlhttp也就是XMLHttpRequest()的应用,发现跟ms很不相同主要是有三点要注意的

第一个是var xmlHttpReq = new XMLHttpRequest();
          xmlHttpReq.open("GET", "http://localhost/xml.asp", false);
          xmlHttpReq.send(null);  //send要有null没有就错了

第二个方法是,如果应用.asp文件是xml文件的时候,一定要用response.ContentType="text/xml"声明一下,不用也错

第三个地方是:var node=xmlHttpReq.responseXML.documentElement.childNodes;
              document.write("当前在线人数" +node.item(0).textContent+"人"); //必须要用textContent如果用text的话,也是不对的

顺便介绍一个小技巧

for(obj_key in node.item(0)){
alert(obj_key);
}

我用了这个方法知道的textContent这个方法的

相关文章:

  • 2021-12-24
  • 2021-09-28
  • 2021-07-02
  • 2022-12-23
  • 2021-07-11
  • 2021-12-08
  • 2021-12-08
  • 2022-01-04
猜你喜欢
  • 2021-09-15
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-01-07
  • 2022-12-23
相关资源
相似解决方案