I am having trouble with the following code snippet:
$(window.document.location).change(function (){
});
Can someone advise me on how to determine the appropriate time to begin sending data back to the server?
UPDATE: To clarify, I am specifically interested in detecting when the user leaves or refreshes the current page. Any suggestions on how to achieve this would be greatly appreciated. Thank you! It seems like I may need to utilize window.onbeforeunload for this purpose.