html javascript print command

Discussion in 'Computer Support' started by cdrakz, Apr 12, 2008.

  1. cdrakz

    cdrakz Guest

    hi,

    im tryin to create a simple webpage that will print the contents of
    the webpage to a printer on a client side machine.

    i know the command is ' window.print() ' and that i can have it in
    the ' onload() ' statement so that the print dialouge appears prior to
    printing.

    here my question. how do i eliminate the Header and Footer information
    that is automatically generated by the webpage?(i.e. the website name
    at the top, and the location url at the bottom)

    any help appreciated.

    regards

    rak
    cdrakz, Apr 12, 2008
    #1
    1. Advertising

  2. cdrakz

    why? Guest

    On Fri, 11 Apr 2008 18:24:58 -0700 (PDT), cdrakz wrote:

    >hi,


    Oh and HTML and Javascript are different things. HTML doesn't have a
    print command.

    >im tryin to create a simple webpage that will print the contents of
    >the webpage to a printer on a client side machine.
    >
    >i know the command is ' window.print() ' and that i can have it in
    >the ' onload() ' statement so that the print dialouge appears prior to
    >printing.


    Don't do that, let someone choose when to print. There are about a
    zillion websites that have a 'Print Article' button and many developers
    sites that explain and have the code how to do it.

    The other problem(s) is if the viewer has Javascript disabled, one
    doesn't have a printer, viewing page on pda, phone etc., no printer may
    be available.

    >here my question. how do i eliminate the Header and Footer information
    >that is automatically generated by the webpage?(i.e. the website name


    Automatically generated how, the webserver, the hosting company?

    >at the top, and the location url at the bottom)


    You can't you are launching the print all of this page, you aren't
    controlling the content to be printed.

    Any 'Print Article' script generally takes care of that. It reformats
    the page for well, printing :)

    Saying that CSS and media types can be used to create a style sheet that
    caters for rendering on a browser and on a printer or other devices.

    >any help appreciated.
    >
    >regards
    >
    >rak


    Me
    why?, Apr 13, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian

    Getting HTML page from JavaScript link?

    Brian, Aug 16, 2004, in forum: Computer Support
    Replies:
    8
    Views:
    461
    data64
    Aug 18, 2004
  2. Bun Mui
    Replies:
    3
    Views:
    815
    Phantom
    Sep 13, 2004
  3. hiralcp
    Replies:
    0
    Views:
    837
    hiralcp
    Dec 19, 2007
  4. Shane

    To Javascript, or not to Javascript

    Shane, Aug 29, 2005, in forum: NZ Computing
    Replies:
    5
    Views:
    432
    Waylon Kenning
    Aug 30, 2005
  5. kit
    Replies:
    0
    Views:
    3,341
Loading...

Share This Page