views:

207

answers:

1

i'm using google gadget "rss tabber" http://www.gmodules.com/ig/creator?synd=open&url=http%3A%2F%2Fclingman.org%2Fplatypus%2Fcustomized-rss-feeds.xml&lang=en

I tried to use jquery to force all the link to open in new window but failed. anyone got suggestion how to do this ? force all the link to be open in new windows?

$('a[href^="http://"]') .attr({ target: "_blank", title: "Opens in a new window" });

A: 

If you look at the code in firebug the links are actually inside there own iframe. I'm guessing thats where the problem lies.

$('iframe').contents().find("a[href^='http://']").attr('target','_blank');

Try that.

Nooshu
If the iframe is on another domain you will not be able to modify the DOM like that.
T B
agreed, it doesnt work because of different domain. any workround?
cometta
I guess you could use some server side code or even jQuery to pull in the RSS feed and add it to your page, that way you have complete control over how it looks and what it does.
Nooshu