dimanche 30 novembre 2014

Check if webpage is closed and run process


Vote count:

0




I have a function that needs to know if the user has closed a page (either by tab, or backing out, or whatever) and run a MVC Controller so I can run a few internal processes. Is this feasible with Javascript or AJAX or impossible? I have the following code:



$(window).bind('beforeunload', function (e) {
// code to execute when browser is closed
e.$.post("/Functions/Left" });

});


But its not doing anything as far as I can see. The Controller processes some database information, and yes it has HTTPPOST.



asked 33 secs ago







Check if webpage is closed and run process

Aucun commentaire:

Enregistrer un commentaire