Disable Highway
All links on a page are automatically attached to Highway with Highway.Core
to call transitions and create an AJAX navigation. Nevertheless some links have to be ignored or might need to be ignored by Highway for good reasons.
Cross-Origin
The links with a URL domain name that is different from the URL domain name of the website are all ignored by Highway for safety and to avoid cross-origin errors that would occur and that would break the navigation process.
<!-- File: index.html -->
<!-- Link ignored by Highway because the URL domain name is different -->
<a href="http://www.google.be"></a>
Try me
Target
The links with a target
attribute are all ignored to keep the default browser behavior related to the value of the attribute. The _blank
value will open the page in a new window or a new tab and the _self
value will reload the page without transitions.
<!-- File: index.html -->
<!-- Link ignored by Highway because of the `target` attribute -->
<a href="path/to/page" target="_blank"></a>
Try me
Javascript
The links with Javascript inside the href
attribute are all ignored to avoid errors that would break the navigation process. Nevertheless the Javascript inside the attribute is still executed so be careful with this kind of use case to avoid malicious code execution.
<!-- File: index.html -->
<!-- Link ignored by Highway because of Javascript inside the `href` attribute -->
<a href="javascript:alert('Hello World');"></a>
Try me
Router Disabled
The links can be programmatically ignored with the data-router-disabled
attribute. This attribute will force the browser to reload the page with transitions.
<!-- File: index.html -->
<!-- Link ignored by Highway because of the `data-router-disabled` attribute -->
<a href="path/to/page" data-router-disabled></a>
Try me