Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print() problem in Opera browser

    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.

    Code:
        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();
        }

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I gave that a try but no joy.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •