Skip to content

Instantly share code, notes, and snippets.

@heidmotron
Created December 18, 2008 16:21
Show Gist options
  • Save heidmotron/37545 to your computer and use it in GitHub Desktop.
Save heidmotron/37545 to your computer and use it in GitHub Desktop.
// since it's synchronous it waits till the request is finished before the window closes
window.onbeforeunload = function() {
new Ajax.Request('/', {method: 'get', asynchronous: false})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment