We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

walepinski on 07/09/06


Tagged

window jquery links


Versions (?)


Who likes this?

18 people have marked this snippet as a favorite

luman
mate
meth
jonbaer
sena
damarev
Leech
mary
hxseven
knowlimit
hollowmyth
bartekk
fael
cwoodley
heinz1959
atnexxt
esquareda
conspirator


[ jQuery ] Target Blank Links


Published in: JavaScript 


Open a new window without using target="_blank" for XHTML 1.1. Need jQuery Framework : http://jquery.com/

  1. $('a[@rel$='external']').click(function(){
  2. this.target = "_blank";
  3. });
  4.  
  5. /*
  6.   Usage:
  7.   <a href="http://www.lepinskidesign.com.br/" rel="external">lepinskidesign.com.br</a>
  8. */

Report this snippet 

You need to login to post a comment.