PDA

View Full Version : print


ebco
04-17-2003, 06:01 AM
I want to open it on click:

function xyz()
{
var printPage = window.open('xyz.htm');
printPage.blur();
printPage.print();
setTimeout(printPage.close(),600);
}

calling this function onclick. It is working onlything throwing error invalid argument on setTimeout

Skyzyx
04-17-2003, 06:30 AM
It should be setTimeout("printPage.close()", 600);

ebco
04-17-2003, 07:05 AM
i can not give printPage in double" b'coz printPage is variable

Skyzyx
04-17-2003, 07:08 AM
That's the way that setTimeout() functions. Sorry.

ebco
04-17-2003, 07:18 AM
u mean this is not possible with settimeout

ebco
04-17-2003, 08:49 AM
is there any other solution for this

ebco
04-17-2003, 09:57 AM
what is the opposte of window.opener

can snybody say

david7777
04-17-2003, 10:13 AM
Originally posted by Skyzyx
It should be setTimeout("printPage.close()", 600);

Skyzyx is right - this is how you do it, and it works like this!

Just try it and see...:D

ebco
04-17-2003, 10:58 AM
I tried it againg but not working giving javascript error that printPage is undefined

david7777
04-17-2003, 12:32 PM
Try this:

var printPage;
function xyz()
{
printPage = window.open('xyz.htm');
printPage.blur();
printPage.print();
setTimeout("printPage.close()",600);
}