最近安装了firefox3以后突然发现之前写的一些ajax请求无法正常的去获取数据了。于是赶快从网上找解决方法。终于在一个僻静的小角落找到了解决方法。马上写出共享之~积德啊积德~
//创建xmlhttp。此写法兼容firefox2,firefox3和ie。 调用处写法: var xmlhttp = createXMLHTTP();
xmlhttp.open("GET","your request url",false); xmlhttp.send(null); if(xmlhttp.status == 200) { if(xmlhttp.responseText.length !== 0) { //此判断的内容为以前的回调函数。不明白为啥firefox3就成了这个样子~ } } |
|