It works because it's asynchronous. The $.get call is fired, and then the
script continues along its merry way, without waiting for the return of the
$.get call.
-- Josh
----- Original Message -----
From: "wsw" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Thursday, July 03, 2008 11:16 AM
Subject: [jQuery] Navigate away after ajax call?
My code:
---in the script---
$('a').click(function() {
$.get('/long_running_page');
return true;
}
---on the page---
<a href="http://www.otherserver.com">click here</a.
This appears to work. The long running page finishes (writes a file on
the server) even though I've navigated to otherserver.com by the time
it's done. Is this documented behavior or am I getting lucky?
Thanks!