make external links open in new tab
This commit is contained in:
@@ -22,6 +22,19 @@
|
||||
// Insert Twitter Pixel ID and Standard Event data below
|
||||
twq('init', 'o745b');
|
||||
twq('track', 'PageView');
|
||||
|
||||
|
||||
// makes all links outside of hostname open in new tab
|
||||
// from: https://stackoverflow.com/a/4425214
|
||||
var links = document.links;
|
||||
console.log(links)
|
||||
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
|
||||
|
||||
if (links[i].hostname != window.location.hostname) {
|
||||
links[i].target = '_blank';
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<!-- End Twitter universal website tag code -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user