print() works in IE7 but not IE6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lightgram
    New Member
    • Sep 2007
    • 9

    print() works in IE7 but not IE6

    Hi

    I am rendering the following Javascript to a print button control in my application:

    [CODE=javascript]
    <script language=javasc ript>
    var WinPrint = window.open('', '','letf=0,top= 0,width=1000,he ight=1000,resiz able=yes,toolba r=0,scrollbars= 0,status=0');
    WinPrint.docume nt.write("This is a test");
    WinPrint.docume nt.close();
    WinPrint.focus( );
    WinPrint.print( );
    WinPrint.close( );
    </script>
    [/CODE]


    In IE7 a new window opens and a print dialog box appears for me to set the printer and send the page off.

    However in IE6 all I get is the data in the window - no print dialog.

    There is obviously a compatibility issue here but I cannot find anything on the web.

    Can someone help me please?

    Thanks in advance.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Try removing the line that closes the window and test that. It may be a timing issue.

    Comment

    • lightgram
      New Member
      • Sep 2007
      • 9

      #3
      Thanks.

      Tried that but it just displays the page - no print dialog.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Are you testing on a full version of IE6 or a standalone version?

        Comment

        • lightgram
          New Member
          • Sep 2007
          • 9

          #5
          Originally posted by acoder
          Are you testing on a full version of IE6 or a standalone version?
          It's a standalone version downloaded via MutlipleIE installer from Tredo.

          I've found that it works OK on a full version of IE6 installed on the test web server that the application is deployed to - 6.0.3790.3959 with SP2.

          However my clients are using full IE6 versions and the print is not working.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by lightgram
            I've found that it works OK on a full version of IE6 installed on the test web server that the application is deployed to - 6.0.3790.3959 with SP2.

            However my clients are using full IE6 versions and the print is not working.
            Well, if you've got it working on a full version, you may need to change a setting on the client's browsers, or they could just upgrade to IE7.

            Comment

            • lightgram
              New Member
              • Sep 2007
              • 9

              #7
              you may need to change a setting on the client's browsers
              Any idea what that may be?

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Originally posted by lightgram
                Any idea what that may be?
                I'm not sure. I assume a normal window.print() within a page works fine? Is this problem only for popups?

                Comment

                Working...