XMLHttpRequest won#39;t work in IE 7/8 but works in other browsers(XMLHttpRequest 在 IE 7/8 中不起作用,但在其他浏览器中起作用)
问题描述
我开发了一个在 chrome 和 firefox 上运行良好的网络应用程序.但是,当涉及到测试时间时,它在 IE 中无法正常工作.它似乎并没有真正得到请求?
I've developed a web application that works well on chrome and firefox. However when it came to testing time and it doesn't work properly in IE. It just doesn't seem to actually get the request?
这里是 Javascript 代码:
here's the Javascript code:
它从 echos 请求的 .php 文件将字符串结果返回给 javascript.
and the .php file it requests from echos back a string result to the javascript.
推荐答案
如前所述这里, Internet Explorer 仅从版本 9 开始支持 XMLHttpRequest 对象的 onload
事件.
As mentioned here, Internet Explorer supports the onload
event of the XMLHttpRequest object only since version 9.
所以,对于 IE 8 及以下版本,你可以用老式的方式来做:
So, for IE 8 and below, you can do it in the old fashioned way:
这篇关于XMLHttpRequest 在 IE 7/8 中不起作用,但在其他浏览器中起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!