onbeforeunload in safari does not run code server side

Posted by Deepa on Stack Overflow See other posts from Stack Overflow or by Deepa
Published on 2010-06-14T12:24:28Z Indexed on 2010/06/14 12:32 UTC
Read the original article Hit count: 400

Filed under:
|
|

On browser close or F5, I have to perform some code on server side For this I have a button. On click of that button which has onclientclick and onclick functions written. I also wrote an event on window.onbeforeunload which does a button.click().

window.onbeforeunload=function(e)
{
   button.click()
}

My problem is that this runs the code of the client side click function of the button, however server side code does not get executed. This happens only when i close the browser. When I do F5 it works perfectly. Also this happens only on Safari. In FF and mozila it works perfectly . How can i

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about safari