I am trying to make a quick AJAX call before a user leaves a webpage. The event on fired in all browsers, but the call to webservic only completes in IE9 and FF10. Chrome, Safari, and Opera all fire the event but seem to kill the ajax call before it can
be made. Ive set jQuery's Ajax property 'async' to false, but that still doesnt seem to help. Any suggestions? I am using the event code below:
jQuery(window).on("unload", function() {
SendLastUpdate();//makes ajax call with async property set to false
});
gdogg
Member
54 Points
42 Posts
Calling webservice from unload event
Feb 29, 2012 08:23 PM|LINK
I am trying to make a quick AJAX call before a user leaves a webpage. The event on fired in all browsers, but the call to webservic only completes in IE9 and FF10. Chrome, Safari, and Opera all fire the event but seem to kill the ajax call before it can be made. Ive set jQuery's Ajax property 'async' to false, but that still doesnt seem to help. Any suggestions? I am using the event code below:
jQuery(window).on("unload", function() { SendLastUpdate();//makes ajax call with async property set to false });