Chrome A標籤的遷移錯誤:【Error loading page】

來源:互聯網
上載者:User

標籤:style   http   color   使用   os   io   strong   for   

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

然後就可以正常的在本地跳轉了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.