如何在IE9使用Ajax使加载本地文件 [英] How to enable loading local file using ajax in IE9
问题描述
我知道有来源问题,而是建立一个Web服务器是不是一个不错的选择。 火狐V14没有问题加载本地文件。 铬有没有问题,加上--allow文件存取的档案'后, 有没有什么办法也解决IE9? 谢谢
I know there is the origin problem, but setting up a web server is not an option here. Firefox v14 has no problem loading a local file. Chrome has no problem after adding '--allow-file-access-from-files' Is there any way to fix also IE9? Thank you
编辑:我想出的解决方案。只要使用的ActiveXObject(MSXML2.XMLHTTP.6.0),而不是XMLHtt prequest()为IE9克服本地文件访问拒绝的问题。
I figured out the solution. Just use ActiveXObject("MSXML2.XMLHTTP.6.0") instead of XMLHttpRequest() for IE9 to overcome the local file access deny problem.
推荐答案
<打击>阿贾克斯与否。击> HTTP是一个客户端 - 服务器应用协议。如果没有一台服务器,这是只是不可能
Ajax or not. HTTP is a client-server application protocol. Without a server, that's just not possible.
更新:
<一个href="http://stackoverflow.com/questions/4270999/google-chrome-allow-file-access-from-files-disabled-for-chrome-beta-8">Possible镀铬(和Firefox)明显。至于IE浏览器,你可以在的标记为已读了网络。
Possible in chrome (and firefox) apparently. As for IE you can read up on Mark of the Web.
这篇关于如何在IE9使用Ajax使加载本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!