Process a file when user exits page?
<p>this is my code so far, what I'm trying to do is process the io_up.php file when the user leaves the page. It was also be great if i could pause the page load for 3sec after file is processed.</p>

<pre><code>&lt;script type="text/javascript"&gt; 
function setConfirmUnload(on) {
    Window.onbeforeunload = (on) ? unloadMessage : null;
}

function unloadMessage() {

    $.ajax({
       async: true,
       url: "/proc_files/io_up.php",
       success: function(msg){
         alert( "Data Saved.");
       }
     });

}
&lt;/script&gt;
</code></pre>
