Thursday, November 4, 2010

Making Wordpress RSS Links open in a new window without editing a file.

Well, I looked around the net and didn't find anything, so I wrote something instead in javascript.  This will allow wordpress RSS feeds to open in a new window instead of the same window of a wordpress site.  I put it in a text widget that is recurring through the website.
 <script type="text/javascript">
function getcrawling()
{
pagecrawl = document.getElementById('page');
acrawl = pagecrawl.getElementsByTagName("a");
for (j=0;j<acrawl.length;j++)
{
if (acrawl[j].className == "rsswidget")
{acrawl[j].target = '_blank';}
}
}
window.onload = getcrawling;
</script>