Quick Jump ↵
Add the code below inside your <body> tag and then update it…
<body>
<script type="text/javascript"> $m.wand.ajax_unload = { callback : "JS_FUNCTION" // optional -- JavaScript callback; defaults to "simple_content_update" ,element_id : "ajax_unloader" // REQUIRED -- a unique identifier ,ga_track : false // optional -- "true" or "false"; defaults to "true" ,method : "get" // optional -- "get" or "post"; defaults to "get" ,password : "" // optional ,query : "NAME=VAR" // optional -- "extra=awesome&foo=bar" ,timeout : // optional -- in seconds ,update_id : "ELEMENT_UPDATE_ID" // optional -- an HTML element that will receive the data from the server ,update_id_action : "overwrite" // optional -- "overwrite", "append", or "prepend"; defaults to "overwrite" ,url : "/PATH/TO/SERVER/SCRIPT/" // REQUIRED ,username : "" // optional } </script>
AJAX Unload will fire when the visitor navigates away from the page either by clicking a link or closing the window.
This does not work in: Opera 12 (the latest version as of this writing) or below - no support for OnBeforeUnload.
You may safely remove the // optional properties from the example.
// optional
Don't rely on this if you're diffusing a bomb.
« Back to the main documentation