Inconsistent ajax (XDR) response from IE

I'm making an ajax request from an iframe that is injected onto every page via an IE plugin. I'm using IE's [cross domain request][1] because jQuery's ajax fails for IE. This works 75% of the time on IE8 & 9. The other 25%, the `xdr.onload` doesn't even fire. The server php is doing its job...the log looks identical for when `onload` does and does not fire. Also, `xdr.onerror` doesn't fire either. Any ideas? thisURL = "http://example.com/getmsg.php?cmd=getMessage&iid=ddeb2c1228&uurl=http%3A%2F%2Fwww.cnn.com%2F&t=" + Math.random(); // Use Microsoft XDR var xdr = new XDomainRequest(); xdr.open("GET", thisURL); xdr.onload = function() { // this is sometimes called, sometimes not in IE alert('INCONSISTENT ALERT'); callback(xdr.responseText); }; xdr.send(); [1]: http://msdn.microsoft.com/en-us/library/dd573303%28v=vs.85%29.aspx
Just a random guess: you could try adding a nonsense parameter to the end of the URL to make sure the browser bypasses its cache ... I would try that myself if it were happening to me, but you may not be as interested in wasting time on complete guesses :-)

以上就是Inconsistent ajax (XDR) response from IE的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏