Please Help !!

Discussion in 'Javascript' started by Melba, May 23, 2005.

  1. Melba

    Melba Guest

    Hi everybody !!
    I need to know when my HTML page is being printed.
    I know there are some events (onbeforeprint and onafterprint), but they
    are firing befor the printing and if someone cancels the printing i can
    not know that.

    Please Help me !!

    Thanks
    Tamara.
     
    Melba, May 23, 2005
    #1
    1. Advertising

  2. Melba

    RobG Guest

    Melba wrote:
    > Hi everybody !!
    > I need to know when my HTML page is being printed.


    You absolutely can't reliably determine when (or if) your page is being
    (or has been) printed using JavaScript. Even if the user's browser
    supports the methods you are using, they may have JavaScript turned
    off, or may be using some other application to display and print your
    page. :-(

    > I know there are some events (onbeforeprint and onafterprint), but they
    > are firing befor the printing


    onafterprint is defined by Microsoft as:

    "Fires on the object immediately after its associated document prints
    or previews for printing"

    <URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onafterprint.asp>

    If that is not happening, then talk to Microsoft.

    > and if someone cancels the printing i can
    > not know that.


    Those two events are Microsoft proprietary events, there is no public
    standard and likely poor support outside Windows/IE. Firefox does not
    support them. You will likely rarely 'know that'.

    >
    > Please Help me !!


    A useful and informative subject will assist in getting help more
    readily. :)

    >
    > Thanks
    > Tamara.
    >



    --
    Rob
     
    RobG, May 24, 2005
    #2
    1. Advertising

  3. Melba

    John Guest

    "Melba" <> wrote in message
    news:...
    > Hi everybody !!
    > I need to know when my HTML page is being printed.
    > I know there are some events (onbeforeprint and onafterprint), but they
    > are firing befor the printing and if someone cancels the printing i can
    > not know that.


    May I ask why you need this?

    There may be another solution.

    For example; if you have printer specific formating, you can probably handle
    it in CSS, or if you are trying to track who is printing what, you may be
    able to handle it via a seperate "printable" page which is assumed to be
    printed every time it is loaded.

    Regards,
    John MacIntyre
    http://www.johnmacintyre.ca
    Specializing in; Database, Web-Applications, and Windows Software
     
    John, May 24, 2005
    #3
    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. JC
    Replies:
    4
    Views:
    7,978
    Jeff C
    Jul 8, 2004
  2. Replies:
    4
    Views:
    521
    Chris Uppal
    May 5, 2005
  3. KK
    Replies:
    2
    Views:
    595
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Replies:
    7
    Views:
    1,765
    Mike Hewson
    Jan 7, 2005
  5. mera
    Replies:
    7
    Views:
    1,112
Loading...

Share This Page