我试图创建一个网站,可以通过启动其索引来下载和运行本地文件。XMLHttpRequest原始空值不允许访问控制允许源文件:///到文件:///(无服务器)
所有的文件都是本地的,没有资源在线使用。
当我尝试使用AJAXSLT的jQuery插件来处理与XSL模板的XML文件(在子目录),我收到以下错误:
XMLHttpRequest cannot load file:///C:/path/to/XSL%20Website/data/home.xml. Origin null is not allowed by Access-Control-Allow-Origin.
XMLHttpRequest cannot load file:///C:/path/to/XSL%20Website/assets/xsl/main.xsl. Origin null is not allowed by Access-Control-Allow-Origin.
的提出请求的索引文件是file:///C:/path/to/XSL%20Website/index.html
,而使用的JavaScript文件存储在file:///C:/path/to/XSL%20Website/assets/js/
中。
我该如何解决这个问题?
谢谢,这只是简化了我的发展。 – Rich 2011-01-30 23:15:00
@很高兴帮助!我想知道Google推动基于浏览器的应用是否会有更大的需求。我认为需求只会增长。 – 2011-01-31 23:54:44
这是有用的Mac OS X http://cweagans.net/blog/2011/1/24/command-line-flags-google-chrome-mac-osx – kinet 2011-02-12 06:43:07