SCRIPT5:在xmlhttprequest上的IE9中拒绝访问 [英] SCRIPT5: Access is denied in IE9 on xmlhttprequest

查看:797
本文介绍了SCRIPT5:在xmlhttprequest上的IE9中拒绝访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var xhttp=new XMLHttpRequest();
xhttp.open('GET', 'foo.xml', false);

F12 弹出:SCRIPT5:访问被拒绝。在第95行,这是xhttp.open行。

F12 pops back: SCRIPT5: Access is denied. on Line 95, which is the xhttp.open line.

我的JavaScript似乎格式正确,Firefox做了我认为应该做的事。

My JavaScript seems well-formed, and Firefox does what I think it should.

我已经阅读了很多与此非常类似的问题,所以我查看了同源策略,但考虑到foo.xml在,我看不出它是如何应用的与html文件相同的目录。我在我的本地Intranet上打开了脚本权限,并告诉迈克菲休息五分钟,这是肯定的。我甚至试过以管理员身份运行IE,所以这不是真正的权限问题吗?为什么IE会被拒绝访问本地文件?

I've read a lot of questions very similar to this one, so I've checked out the Same Origin Policy, but I can't see how it'd apply considering foo.xml is in the same directory as the html file. I opened up the scripting permissions on my local intranet, and told McAfee to take a five-minute break, just to be sure. I even tried running IE as admin, so this can't really be a permissions issue can it? Why else would IE be denied access to a local file?

推荐答案

也许您想查看以下链接:

Maybe you like to check the links below:

  • Making cross domain JavaScript requests using XMLHttpRequest or XDomainRequest
  • XMLHttpRequest – Mozilla Developer Network
  • A good summary of the jQuery x-domain requests
  • Which browser supports x-domain?

这篇关于SCRIPT5:在xmlhttprequest上的IE9中拒绝访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆