Results 1 to 5 of 5

Thread: Need help with Alternate Document Print

  1. #1
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with Alternate Document Print

    I can get this to work in IE but not FF. The script is supposed to be cross browser friendly.

    DD's link:
    http://www.dynamicdrive.com/dynamici...printstyle.htm

    My page:
    http://blockstyle.com/print_command.htm

    Any ideas?
    Last edited by khblock; 05-03-2006 at 08:04 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by khblock
    I can get this to work in IE but not FF. The script is supposed to be cross browser friendly.

    Isn't. Try Google for "media=print". The top result should be the w3c's page on this which, though accurate, can be a bit involved. This Link:

    http://www.meyerweb.com/eric/article...ev/200001.html

    Looked fairly basic and useful. There are different ways to do this that are mostly cross browser. The method outlined at DD here is IE specific, even though it says otherwise.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your reply.

    Its still doesn't work in FF though. I've searched the net extensively and it seems others are also having this issue as well.

    I tried the link you offered and every variation of the tag possible and its just not an option at this time.

    I'm now using javascript.

    Thank you again and take care.
    k

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Javascript is unreliable. Many folks have it turned off. This (taken loosely from that link) worked in IE6, FF1.5.0.3 and Opera8.54:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    
    @media print {
       BODY {font-size: 20pt; line-height: 120%; background: white;color:black;}
    }
    @media screen {
       BODY {font-size: medium; line-height: 1em; background: silver;color:red}
    }
    
    </style>
    </head>
    <body>
    Yo
    </body>
    </html>
    I'm fairly sure the other methods outlined will as well.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by khblock
    Its still doesn't work in FF though.
    Print style sheets do work in a large number of browsers. If you're having problems, then you'll have to post a link to an example. At a guess, there's a specificity issue, but guessing is a waste of time.

    Incidentally, the 'Alternate Document' example you referenced at the start of this thread is due to be removed from DynamicDrive.

    Mike

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
  •