On 15/11/06, digital spaghetti <[EMAIL PROTECTED]> wrote:
> Hi Folks,
>
> Ok, I am being stupid and can't work this out and it's probably so
> simple. What I want to do is keep my site XHTML valid, so I don't
> want target= params in any of my links, I want to use jQuery to take
> the href param from any clicked link with rel="nofollow" which only my
> external links have, and pop it into a new window. My code so far
> looks like this:
>
> $(document).ready(
> function(){$("[EMAIL PROTECTED]").click(
> function() { window.open("a.href") }
> ); }
> );
>
> Now, from this all I am getting is a pop up to the URL a.href, and in
> the window that the original link is in, that goes to the URL I want
> the popup to go to. Can anyone see where I am going wrong, or it
> could just be me misunderstanding jQuery. I also tried
> window.open($("a").href) as well, but with no luck.
>
> Thanks.
> Tane
$(document).ready(
function(){$("[EMAIL PROTECTED]").click(
function() {
window.open(this.href); return false;
}
); }
);
You need 'return false' otherwise the current window/tab will load the
new page as well.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/