Last active
December 14, 2015 10:09
-
-
Save bluespore/5069484 to your computer and use it in GitHub Desktop.
Open any user data links to new window if it is an external page to ensure visit times aren't broken (SEO)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('[data-user-content]').find('a').on('click', function(){ | |
if( $(this).attr('href').indexOf('SITE_URL_HERE') >= 0 ){ | |
return true; | |
} | |
else{ | |
window.open($(this).attr('href'), '_blank'); | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment