Results 1 to 6 of 6

Thread: autoprint is working in IE and is printing a empty page in FF

  1. #1
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy autoprint is working in IE and is printing a empty page in FF

    Hy,
    This script is working very good in IE and there is a perfect print.
    When i try it under FF than is everything good accept the empty page
    (only time, date, name and page number)

    Can somebody help to fix this please

    THE SCRIPT


    <script type="text/javascript">
    <!--
    function autoprint()
    {
    F1 =
    window.open("1.htm","_blank","width=310,height=400,left=0,top=0");

    F1.focus();
    F1.print();
    F1.close();
    }
    //-->
    </script>
    <a href="javascript:autoprint()";>print</a>
    Last edited by thebosdj; 11-26-2006 at 08:56 PM.

  2. #2
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Still no solution

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    can you post a link so that we may look at it in action?
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. #4
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default See it in action

    see it in action:
    http://webbee.be/print

    see the printing page:
    http://webbee.be/print/1.htm

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    I have looked it over, and come to a solution. Try the following:

    test.html

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Testing autoprint</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <script type="text/javascript">
    <!--
    function autoprint()
    {
    
    F1 = window.open("1.htm","_blank","width=310,height=400,left=0,top=0");
    
    F1.focus();
    }
    //-->
    </script>
    
    </head>
    
    <body>
    <div align="center">
      <p><img src="1.gif" width="207" height="248" border="1"></p>
    
    </div>
    <div align="center"><a href="javascript:autoprint()";>print</a> </div>
    </body>
    </html>
    1.htm

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <script language="JavaScript">
    <!--
    
      window.print();
      window.close();
    
    //-->
    </script>
    <title>Printing page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <div align="center"><img src="1.gif" width="600" height="800"> 
    </div>
    </body>
    </html>
    I have tested it in both FF and IE and it seems to do what it's supposed to. Let me know if this helps you out.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  6. #6
    Join Date
    Nov 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    A big thank you.
    This is the solution i needed!

Bookmarks

Posting Permissions

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