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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.