Open Link in new Window


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $('a[rel*=external]').click( function() {
  2. window.open(this.href);
  3. return false;
  4. });
  5.  
  6. // Better Solution
  7. // thanks to: emelendez
  8. $('body').delegate('a[rel=external]', 'click', function(){
  9. window.open(this.href);
  10. return false;
  11. })

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.