...

View Full Version : Print() problem in Opera browser



alanr
12-07-2009, 02:05 PM
The following JavaScript seems to work correctly in all browsers I've tried so far apart from Opera (Iím using version 10.10). The problem seems to be that the .Print(); call does not bring up the print dialog as on other browsers. Any help in getting this working for all browsers would be appreciated.



function Print(id) {
var DocumentContainer = document.getElementById(id);
var WindowObject = window.open("", "PrintWindow", width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes");
WindowObject.document.write('<body style="font-family:verdana; font-size:12px;">');
WindowObject.document.writeln(DocumentContainer.innerHTML);
WindowObject.document.close();
WindowObject.focus();
WindowObject.print();
WindowObject.close();
}

Kor
12-07-2009, 03:37 PM
Maybe this happens because you don't write a full HTML document within that popup. You should write the <html>, the <head> </head> and you should write also the close tags </body> and </html> in the end.

alanr
12-07-2009, 03:58 PM
I gave that a try but no joy.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum