PDA

View Full Version : Problem with dynamic Iframe



sweetsen
06-10-2007, 11:26 PM
Hi , I have a problem with dynamic Iframe in a web page.
When i click the SaveAll button , It should save the reports generated on the particular Date.

It works fine in Firefox, But in IE it saves only the first file.

Code:
function makeIFrame(i)
{
var iframe = document.createElement("iframe");
iframe.setAttribute("id", "downloader_"+i);
iframe.setAttribute("height", "0px");
iframe.setAttribute("width", "0px");
document.body.appendChild(iframe);
}

function saveAll(completed_Date)
{
var i = 0;
var tempArray =new Array();
var j=0;
<xsl:for-each select="/xml/reports_completed">
if('<xsl:value-of select="completed_dts"/>'.substring(0,8) == completed_Dts.substring(0,8))
{
makeIFrame(i+1);
var el=document.getElementById('downloader_'+ (i+1));
tempArray[j] = '<xsl:value-of select="report_id"/>';

if (!el)
{
alert("Cannot download report because the IFRAME has disappeared");
}
else
{
el.src="reports_scheduling.do?report_id=" +tempArray[j];

}
i+=1;
j++;
}
</xsl:for-each>

}

I dont know why its not working in IE.Plz help me!

Thanks in Advance,

Regards,
Senthil