I realize this is an IE thing. I'm trying to find out when a page is printed in every way possible. As the majority of internet users use IE, this is one method. Please don't lynch me for this
. And yes, I know that firefox is quickly coming up in the ranks. I like firefox.
I just found out these two events exist.. the problem is that descriptions are wrong.
OnBeforePrint is supposed to do something to the page just before a print is requested.
OnAfterPrint is supposed to do something to the page after the print has been loaded into the print queue (which does not necessarily mean that the page got printed.
The problem is that as a test, I setup this code:
And as soon as I hit the print command in IE, my title bar becomes "Printed 2".. Even if I cancel the dialog (so that the page is never loaded into cache). I get no effect in any instance from onbeforeprint though I haven't tried running it without onafterprint because onbefore print is of no use to me.
Thoughts?
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
I just found out these two events exist.. the problem is that descriptions are wrong.
OnBeforePrint is supposed to do something to the page just before a print is requested.
OnAfterPrint is supposed to do something to the page after the print has been loaded into the print queue (which does not necessarily mean that the page got printed.
The problem is that as a test, I setup this code:
Code:
<script>
function window.onbeforeprint(){
document.title = 'Printed 1';
}
function window.onafterprint(){
document.title = 'Printed 2';
}
</script>
And as soon as I hit the print command in IE, my title bar becomes "Printed 2".. Even if I cancel the dialog (so that the page is never loaded into cache). I get no effect in any instance from onbeforeprint though I haven't tried running it without onafterprint because onbefore print is of no use to me.
Thoughts?
ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.