I want to call an URL in the unload-Function of a Webpage but in the unload-function the get request is not working. My code looks like this:
$(window).unload( function () {
jQuery.get("someurl")
} );
We want to be informed about the closing of the window for some logging of user actions. Is it possible somehow?
If i add an alert() after the jQuery.get(), the Get-Request has enough Time, to do this, but that's not what we prefer.
Use:-
jQuery.ajax({url:"someurl", async:false})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With