On Mon, Jul 28, 2008 at 2:15 PM, Collin Grady <[EMAIL PROTECTED]>wrote:
> Jack Moffitt said the following: > > Does anyone have ideas for how to work around this? >>> >> >> We aren't trying anything as ambitious as pausing in unbeforeunload, >> and we have not gotten that event handler to work reliably cross >> browser. As I recall, and maybe collin can correct me, only IE really >> supports this well. I hope I am wrong, and look forward to other >> people's suggestions/solutions to the problem. >> > > beforeunload works sometimes in non-IE browsers, but not all, and in some, > not all the time - we had to hook both beforeunload and unload to get our > handler firing as reliable as possible > mmm, interesting. I guess I should have done my homework before trying this approach =]. Suggestions from many forums is to use a synchronous xhr connection in unload, which could work for normal BOSH but not script syntax (which my app will be using for xdomain properties). Can you elaborate on the dual-handler method and how reliable it is, and possibly give a code example? A thought that I just had: what if my app just always keeps track of the sid/rid/keys in a cookie/localStorage and checks for that during construction on the connection in the next page load? In fact, I could even call resume() as normal since all a pause does is temporarily extend 'wait', and resume just loads up the state with a serialized object returned by pause. With a long enough 'wait' specified, it should work. Though I would consider this a hack =[.
