Entry
Can I execute some php code in an unLoad statement. I've tried but I'm not JavaScript handy. :) I'm looking for a unload("<? commands ?>")
Jul 29th, 2001 22:06
Onno Benschop, John Marc, John,
No.
The unload command is javascript. Therefor all commands between the
quotes are also javascript.
Let me elaborate:
An unload event is issued by the browser when a page is about to close.
The language of this event is javascript.
So, no you cannot have PHP code execute on an unload.
You could make a PHP page, and have the unload command call that php
page by reference.
You could have PHP generate the actual script for the javascript
unload, but you cannot have PHP directly execute as the result of a
browser unload.