Posted By

batfan on 07/27/10


Tagged

jquery links


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jeremyalfordgmailcom
dubogii


Open All Off-site Links in a New Window


 / Published in: jQuery
 

  1. $(document).ready(function() {
  2.  
  3. $("a").filter(function() {
  4. return this.hostname && this.hostname !== location.hostname;
  5. }).attr('target', '_blank');
  6.  
  7. });

Report this snippet  

You need to login to post a comment.