XMLHttpRequest cannot load file:///D:/work/ Or...

google浏览器访问jason文件出现Origin null is not allowed by Access-Control-Allow-Origin. 让chrome支持本地Ajax请求通常状况下,在chrome中运行一些含Ajax请求的界面原型时,会抛出下面错误:XMLHttpRequest cannot load file:///D:/eclipse/workspace/uiTest/WebContent/table1.html. Origin null is not allowed by Access-Control-Allow-Origin.从网上看到了解决办法,记下来以备忘:给chrome加上启动参数:--allow-file-access-from-files就能够了(须要关闭全部chrome窗口重启浏览器)。
相关文章
相关标签/搜索