Let us know how it goes... The unload event had been tried also. The javascript have been running for a while but the network communication is a bit tricky, it haven't worked well.
"Víă Ăđă " <[EMAIL PROTECTED]> wrote in message 004701c2b90d$5de0c440$0700a8c0@sp">news:004701c2b90d$5de0c440$0700a8c0@sp... > > Yes, the JavaScript code can run before the browser is closed but it would > > not be finish running because the browser closing had been executed. > > Someone had tried it before and struggled with it. But that is a good > > advice, thanks for jumping in. > I really doubt that browsers doesn't run the code that is in unload event of > the page because the window is closed. That would be a very bad thing. Isn't > it what the unload event is for? I mean to run code when the page is > unloaded, it doesn't matter if the window is being closed or the user is > going to another page. I think the browser should finish all the opened > window's unload code and only after that close the application really. > I made a quick test for it: > <html> > <head> > <script language=javascript> > function wait(msec){ > var enter_date = new Date(); > var enter_time = enter_date.getTime(); > > var leave_date = new Date(); > var leave_time = leave_date.getTime(); > > while (enter_time + msec > leave_time) > { > leave_date = new Date(); > leave_time = leave_date.getTime(); > } > alert('unload test'); > } > </script> > </head> > > <body onunload="wait(5000)"> > unload test > </body> > </html > > It works fine for me in ie6 and mozila 0.9.6, it shows the alert message > after about 5 seconds. > > Arpi > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php