Created
July 31, 2013 09:18
-
-
Save l4u/6120634 to your computer and use it in GitHub Desktop.
open external links in a new window
coffeescript turbolinks
This file contains hidden or 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
$(document).on 'page:load', -> | |
links = document.links | |
for link in links | |
if (link.hostname != window.location.hostname) | |
link.target = '_blank' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment