It doesn't have to let the browser know that its finished, as it will
just be calling a function to release any reservations that aren't
complete. It doesn't have to be 100% reliable as they are released
after a timeout by default, but the faster they are freed up the
better.

The problem I have is that I don't want to hit the server on every
single unload event, so I need to check the domain is changing before
sending the release request.

If it's not possible then it's not possible, just wondering if anyone
had done something similar in the past.


On 14 May, 11:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I think that might be hard to do.
>
> One way of solving part of the problem is to bind a function to all
> links on the page, and do a check if the link they clicked on goes to
> another site, then you could perform your ajax-request, and then send
> them on their way.
>
> This only works when they click on a link on your site. If they type
> an address in the address bar then you will not catch that they are
> leaveing.
>
> Even if you do manage to get the onunload to work and get the url they
> are headed to, you might get a problem with the ajax-call. I'm not
> sure that the browser will be able to perform the ajax-call, or even
> wait for it to finish. I guess that you would have to send it asynch
> if you want to be sure that it will finish.
>
> Good luck and tell us how you solved it.
>
> On May 14, 11:39 am, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Is it possible to get the browsers next url from an onunload call? I'm
> > trying to determine if a user is leaving my site, and if they are,
> > send an ajax request.

Reply via email to