/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// If href does not contain "http" at the beginning, or it's an absolute, but local href, must be local. var isLocal = ( !/^(http)/.test(href) ) || ( href.indexOf(location.hostname) > -1 );