Please Help !!

M

Melba

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.
 
R

RobG

Melba said:
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. :)
 
J

John

Melba said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Malicious Coding Help Please 5
Help please 8
Need help again please 19
Please Help 2
Hello and Help please :-) 1
Please help me!!! 3
I dont get this. Please help me!! 2
Please help 7

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top