Results 1 to 5 of 5

Thread: "Print" links and users without Javascript.

  1. #1
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default "Print" links and users without Javascript.

    Hi all,

    How do you handle "print this page" links for users without Javascript?

    I was thinking a good option would be to have the HREF for the link be to a page explaining how to enable Javascript.

    Does Javascript affect a print CSS file? Users without JS enabled still get the print CSS, right?

    Thanks!

    EDIT: "how do you" meaning you personally, on your own projects. I know users without JS have to use File > Print. :P
    Last edited by jlizarraga; 02-13-2009 at 12:38 AM. Reason: clarification

  2. #2
    Join Date
    Aug 2008
    Location
    karanganyar, solo, indonesia
    Posts
    161
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    i just know this

    Code:
    <a href="javascript:void(0);" onclick="if(window.print) window.print();return false;">Print</a>
    ///////////////////////////////////////////////////
    ///// http://www.mediatutorial.web.id
    ///////////////////////////////////////////////////

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    I don't think the printing can be achieved without using JS. Of course the user will be able to print it through the File -> Print option in the browser window.

    There are certain things that can not be achieved without using programming.

  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

    What I do is first assume that anyone without javascript enabled who is wanting to print a page will know how to do so. Second, I code all my print this page or print whatever links and buttons in javascript, so that they aren't even seen by non-javascript enabled browsers.

    The only pages that I'm all that concerned with folks printing are things like schedules or directions. If I give them a link to a printer ready page, they will get the idea with or without javascript enabled. Sometimes I just make it easier for the javascript enabled folks though.

    Finally, yes - even without javascript enabled, your print css will still be in effect.
    - John
    ________________________

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

  5. #5
    Join Date
    Sep 2008
    Posts
    119
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    If you are using php as well, you can also always utilize the pdf lib, and allow them to save as a pdf as a nice alternative.

    http://www.digitaljunkies.ca/dompdf/examples.php#demo
    document.write is document.wrong

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
  •