Chrome A标签的迁移错误:【Error loading page】

在IE中经常使用A标签用来迁移,正确的写法是

<a href="001.html"></a>即可,不过在chrome上面可能会引发错误无法迁移。

比如用下面这种写法的时候:

<a href="001.html" data-role="button" data-mini="true"
      data-icon="camera" data-iconpos="left" data-transition="none">link001</a>

把当前页面右键用chrome打开进行跳转动作的时候,会报错:

【Error loading page】

用F12看下console会发现错误信息:

XMLHttpRequest cannot load file:///E:/html/001.html. Received an invalid response. Origin 'null' is therefore not allowed access.

查了下具体原因是chrome不进行本地的跳转。认为是不安全的应该。

网上有人给出解决方案,从开始菜单命令行来启动chrome: chrome.exe –disable-web-security

现在给出另外一个解决方案,因为我不太想让chrome以那种方式启动,于是就增加了a标签的属性

<a href="001.html" data-role="button" data-mini="true"

      data-icon="camera" data-iconpos="left" data-transition="none" rel="external">link001</a>

然后就可以正常的在本地跳转了。

posted on 2014-08-18 09:46  扭头撞到墙  阅读(1074)  评论(0编辑  收藏  举报