I wrote a CF page to parse XML and display the contents on the web. The contents are a bunch of news links; I would like the links to open in a new window and reuse the window instead of opening multiple windows. I am really close to getting it to work but whenever I test the page it only opens the same news link over and over again. It doesn't seem to recognize any of the other news items in the array result set. Any one got any tips?
<cfloop index="i" from="1" to="#ArrayLen(SearchResults)#">
<tr>
<td width=400 valign="top" nowrap>
<cfoutput>
<script language="JavaScript" type="text/JavaScript">
function newsFeed()
{
var printdata = window.open("#SearchResults.link.XmlText#",'printdata')
}
</script>
<img src="../images/bullet.gif"> <a href="javascript:newsFeed('#SearchResults.link.XmlText#')" class="style1">#SearchResults.title.XmlText#</a><br>
</cfoutput>
<cfloop index="i" from="1" to="#ArrayLen(SearchResults)#">
<tr>
<td width=400 valign="top" nowrap>
<cfoutput>
<script language="JavaScript" type="text/JavaScript">
function newsFeed()
{
var printdata = window.open("#SearchResults.link.XmlText#",'printdata')
}
</script>
<img src="../images/bullet.gif"> <a href="javascript:newsFeed('#SearchResults.link.XmlText#')" class="style1">#SearchResults.title.XmlText#</a><br>
</cfoutput>