SenchaTouch调试浏览器加载本地资源报错问题

使用Safari及Chrom调试加载本地资源报错:

XMLHttpRequest cannot loadfile:///Users/enway/Documents/Project/projectWorkspace/renjianwei/PSIMobile/apps/MSCPSI/common/app/view/Navi/NaviList.js?_dc=1396434945949. Cross origin requests are only supported for HTTP.

解决方案(Windows):

Chrome:

1、得到Chrome的安装路径,例如:

C:\Users\-your-user-name\AppData\Local\Google\Chrome\Application

2、在命令行窗口,输入安装路径,加上–allow-file-access-from-files参数,例如:

Chrome installation path\chrome.exe --allow-file-access-from-files

,回车执行,启动Chrome
3、测试的一个临时方法::复制一个Chrome的快捷方式,右键->属性->目标的文本框中加上参数

--allow-file-access-from-files

,例如:

"Chrome installation path\chrome.exe" --allow-file-access-from-files
解决方案(Mac OS):

Chrome:

从命令行窗口中启动,启动命令为

open -a "Google Chrome" --args --disable-web-security

Safari:
1、Safari->偏好设置->高级->勾选“在菜单栏中显示‘开发’菜单”
2、开发->勾选“停用本地文件限制”


你可能感兴趣的:(SenchaTouch)