Hi all,

New to jQuery, and I'm trying to use it to set my external links to open a
new window without using any attributes to  mark the external links.  I can
do this with regular js, using a.href.match, but I can't get it to work with
jQuery.  Tried various directions, but no go.

Sure I'll feel pretty stupid when this is answered, but here is my ugly,
non-functioning code:

$(function(){
    if ($!("a").href.match("http://www.internal.com";)) {
        $("a").click(
             function() {
                 window.open(this.href); return false;
                 console.log("external");
             };
        ); 
    };
});



Thanks for any help,
Adam
-- 
View this message in context: 
http://www.nabble.com/Change-href-of-external-links-tf2718387.html#a7579373
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to