Hi,
I was just looking at this again, and wondered how I could make it work with
a string of links to not be external. For example using a for loop to go
through var intLink = link1, link2, link3, etc. Just not sure how to go
about getting the loop in there.
$("[EMAIL PROTECTED]:not([EMAIL PROTECTED]'"+intLink+"']):not(.thickbox)")
.bind("click", function(){ return !window.open(this.href); });
Adam
dave.methvin wrote:
>
> Even better, you could use the :not() selector to do the job all at once,
> I
> forgot about it.
>
> $("[EMAIL PROTECTED]:not([EMAIL PROTECTED]'internal.com/']):not(.thickbox)")
> .bind("click", function(){ return !window.open(this.href); });
>
> This is the way jQuery optimization usually goes. You start with 10 lines
> of
> jQuery that would have been 20 lines of tedious DOM Javascript. By the
> time
> you are done it's down to two or three lines and it couldn't get any
> shorter
> unless it read your mind. :-)
>
--
View this message in context:
http://www.nabble.com/Change-href-of-external-links-tf2718387.html#a7876017
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/