Thanks for all the replies! I had tried the unload event, but I had
the same doubts Klaus had about the reliability of that approach,
which is why I asked here to get some insight on the problems with
doing something like this. Of course, persisting the icons when they
are moved would be easier, but in this case the application using this
code will have several million hits per day, so a user scratching his
nose too hard has the potential to cripple the server farm-- the more
efficient solution is to persist only when necessary: page change,
logout, or browser exit. I just want to know whether the unload event
can handle that kind of pressure reliably, before I have to find out
the hard way that it doesn't.
So, I guess the next logical question is to Klaus: what are the
specific reasons for your doubts? Maybe we can work through those
systematically and come up with a solution that people can use in
general in similar circumstances!
Thanks again,
Pete
On Nov 16, 6:32 pm, Wizzud [EMAIL PROTECTED] wrote:
I hesitate to suggest that a simpler approach may be to store the
positions as they change, rather than wait until thebrowsersuddenly
disappears, shuts down, moves to another page, or whatever?
On Nov 15, 11:50 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
On Nov 15, 9:35 pm, Bil Corry [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote on 11/15/2007 8:12 AM:
I'd just like to know what the jQuery best practice for catching the
browserexiteventis?
Probably just bind your code to the onunloadevent. From the jQuery docs:
$(window).unload( function () { alert(Bye now!); } );
More info here:
http://docs.jquery.com/Events/unload
- Bil
I doubt persisting data via an Ajax call on the unloadeventwill work
crossbrowserif at all... but I'm not sure about this.
--Klaus