Jump to content

how to run javascript even browser is closed


phpdeveloper123

Recommended Posts

window.onclose

The window close event is not part of any standards, and so doesn't have great support across browsers. It's not recommended for use. The window unload event is standardised, however again it shouldn't be used except for in exceptional circumstances, as browsers can't cache the page when you use it. I don't think this is what the OP is after anyway.
Link to comment
Share on other sites

The simple answer is that you cannot, as javascript runs in the browser, and if the browser closes, there is nowhere to run the javascript.

 

That said, there is server-side javascript as well, so theoretically something could be done, but I really doubt that is the answer for the OP.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.