I've got this javascript newsfeed on a webpage.
Is there a way to make the link items in it open in a new window/tab?Code:<SCRIPT language=JavaScript src='http://www.gop.com/Feeds/NewsFeed-Wide.aspx'></SCRIPT>
Thanks!
![]() |
I've got this javascript newsfeed on a webpage.
Is there a way to make the link items in it open in a new window/tab?Code:<SCRIPT language=JavaScript src='http://www.gop.com/Feeds/NewsFeed-Wide.aspx'></SCRIPT>
Thanks!
have you tried target="_blank"
Yeah, tried it in a few places in there and none worked.
Since you're not actually controlling the feed page yourself, there isn't really any easy way to do it.
You could write a server side script that reads the news page, sorts through it, and adds a
To all theCode:target="blank"
That would be about it...Code:<a href="http"//pagename/story.aspx">Link Text</a>
Thanks sirhC.
That hurt my brain to read it :) so I'll just nix the feed. Not that important to have it on my site... I just discovered it while rooting around the supplier's site.
Actually it's not really that bad with a few lines of JavaScript...
Every link in the feed will now open in a new browser window, even the gop.com link in the footer.Code:<div id="newsSource">
<SCRIPT language=JavaScript src='http://www.gop.com/Feeds/NewsFeed-Wide.aspx'></SCRIPT>
</div>
<script>
var regExp = /<a /ig;
var newsFeed = document.getElementById("newsSource");
var newsFeedSrc = newsFeed.innerHTML;
newsFeedSrc = newsFeedSrc.replace(linkRegEx,"<A target='_blank' ");
newsFeed.innerHTML = newsFeedSrc;
</script>
HTH,
-Jeff
All times are GMT -7. The time now is 07:34 PM. |