sencha touch 2 在chrome下不能正常显示的解决方案

chrome下之所以不能正常显示,是因为我们是使用本地的html文件访问,如file://...来访问的。
这时,如果用safari访问是正常的,但用chrome访问,就会一片空白,因为这里,chrome有一个xss的安全设置。如果想让chrome能正常显示内容:
如果在mac下:
打开终端,

$ open -a Google\ Chrome --args --disable-web-security

 

如果你想访问本地文件比如ajax,json,只要再加上:

-–allow-file-access-from-files

 

在PC端:
右键chrome图标,属性,在打开方式里:
加入
--disable-web-security
当然,也可以使用cmd命令行,先到chrome所在文件夹,然后

chrome.exe --disable-web-security
posted @ 2012-07-16 10:09  Phnix  阅读(871)  评论(0编辑  收藏  举报