|
"setTimeout" function won't work
Hey programmers!!
I'm having big trouble trying to figure this one out. I have a page with a "Print All" button, but only one frame is showed at the time. The idea is to redirect the frame in order to get the next page, well, that part is already done, but I need to wait till the last page is printed so I can call the next one, therefore I use setTimeout function, but nothing happens. The excecution won't pause and I only get to print one page, besides the errors I get from redirecting so fast the frame. Well I'll leave my script, hoping somebody might help. Thanks...
while(parseInt(lastprinted)<parseInt(lastnumber)){
var frame=fraAux; //fraAux is the frame I'm using
lastprinted=fraAux.document.forms[0].hdnPag.value;// page counter
var s="Printing Page"+frame.document.forms[0].hdnPag.value+". Wait untill page is fully printed, then hit ''Ok''";
fraAux.location.href ="frmCodResult.aspx?Value="+sValue+"&Since="+sSinc e+"&Untill="+lastnumber+"&Begin="+(parseInt(lastpr inted)+1);
//redirects the frame and loads next page
factory.printing.print(false,frame); //send to printer without prompting
setTimeout('',10000); //this doesn't work
alert(s);// send an alert, so it'd "manually" wait
}
|