在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>

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

相关文章:

  • 2021-05-20
  • 2021-10-27
  • 2021-09-15
  • 2022-12-23
  • 2021-07-17
  • 2021-11-10
  • 2021-09-15
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2021-11-10
  • 2021-12-27
  • 2021-08-09
  • 2022-12-23
  • 2021-07-06
  • 2021-07-13
相关资源
相似解决方案