SCRIPT5: Access is denied in IE9 on xmlhttprequest(SCRIPT5:在 IE9 中对 xmlhttprequest 的访问被拒绝)
问题描述
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 上打开了脚本权限,并告诉 McAfee 休息五分钟,以确保安全.我什至尝试以管理员身份运行 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:
- 使用 XMLHttpRequest 或 XDomainRequest 进行跨域 JavaScript 请求
XMLHttpRequest
– Mozilla 开发者网络- 对 jQuery x 域请求的一个很好的总结
- 哪种浏览器支持x域?
- 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:在 IE9 中对 xmlhttprequest 的访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SCRIPT5:在 IE9 中对 xmlhttprequest 的访问被拒绝


基础教程推荐
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01