Make child close automatically after 3 seconds
Hi all,
Here's the problem.
I am opening a child window from a parent window using the window.open() method, and then rendering an image and some text in the child window using document.write() method .
I want to actually implement the child as a popup window and then close the child after 3 seconds of activation.
Here's the javascript function that does all that on clicking a button in the parent :
function open_win()
{
var x=window.open("","win1","menubar=no toolbar=no width=300 height=150");
x.moveTo(screen.AvailWidth/3,screen.AvailHeight/3);
x.document.write("<center>");
x.document.write("<table bgcolor='steelblue'>");
x.document.write("<tr><td align=center><b>Saving the File...</b></td></tr>");
x.document.write("<tr>");
x.document.write("<td align=center><img src=upload_img.gif></td>");
x.document.write("</tr>");
x.document.write("<tr>");
x.document.write("<td align=left>");
x.document.write("This may take a few minutes.<br>Please Wait...");
x.document.write("</td>");
x.document.write("</tr>");
x.document.write("<tr><td> </td></tr>");
x.document.write("</table>");
x.document.write("</center>");
setTimeout('self.close()',3000);
}
It's not working. The child window stays as is.
How do I make the child close automatically after 3 seconds ?
Any ideas ??
Regards,
Sherbir
__________________
Regards,
Sherbir
|