Chrome 访问本地文件

使用chrome访问本地html文件时会有如下错误:

Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin.


解决办法:

    给Chrome添加启动参数:--allow-file-access-from-files 或  --disable-web-security


记得设置参数后关闭所有chrome浏览器,在打开浏览器。

猜你喜欢

转载自xwhoyeah.iteye.com/blog/2003626