Hidding of Browser window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

Hidding of Browser window

Post by habib009pk »

Dear Friends

I am using that code

hs.Expander.prototype.getPrintPage = function() {
// We break the closing script tag in half to prevent
// the HTML parser from seeing it as a part of
// the *main* page.

return "<html>\n" +
"<head>\n" +
"<title>Temporary Printing Window</title>\n" +
"<script>\n" +"function step1() {\n" +
" setTimeout('step2()', 10);\n" +
"}\n" +
"function step2() {\n" +
" window.print();\n" +
" window.close();\n" +
"}\n" +
"</scr" + "ipt>\n" +
"</head>\n" +
"<body onLoad='step1()'>\n" +
"<img src='" + this.content.src + "'/>\n" +
"</body>\n" +
"</html>\n";
};

This code is using for the printing of images in Highslide, now the problem is that when i click to print the desired image firstly image appears in new window then printing dialog box will be opened than after getting the print the the new temporary window will be closed automatically after 10 neno seconds.

But my requirement is that when i click the print button i automatically get the printing dialog box and no temporary window will be opened which will carry the image.

so kindly give me any suggestion but my idea is that i want to hide the Temporary Window, which works but in hidden form
so user will directly got the print dialog box.

kindly give me the code which will hide the temporary window what code can i use for it

Waiting for you reply.
Regards
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Hidding of Browser window

Post by kaszu »

That can't be done as far as I know, because you need that temporary window so that there would be something to print and since print dialog is for that window it needs to be open.
habib009pk
Forum Commoner
Posts: 43
Joined: Sun Jul 05, 2009 11:28 pm

Re: Hidding of Browser window

Post by habib009pk »

Then plz give me any suggestion what can i do for it

i also modify the code such as


" window.resizeTo( 0,0 );\n" +
" window.moveTo(300, 300)\n" +
" setTimeout('step2()', 10);\n" +
"}\n" +

This code reduce the Browser window and move the window to my desired location, i wrote that code bcz of the temporary window hide before the print dialog but the problem is the code is running successfully but the print dialog appears w.r.t the temporary window if it appears in left then print dialog appears also in left but below the tempoaray window. which give me not the full result

kindly give me any suggestion for my problem. which will hide the temporary window either in visible form or before the print dialog.

Thanks and Regards
Post Reply