A timeout is not an error??

On 17 ago, 07:42, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> I guess thetimeoutjust means it will stop trying to complete the
> request. I've never actually tried to use it. To get an alert like you
> want, you might try using your own timer (untested):
>
> var ajax_timeout;
> $.ajax({
>   ...,
>   beforeSend: function() {
>     ajax_timeout = setTimeout(function() {
>       alert('Request is taking a long time.');
>     }, 5000);
>   },
>   success: function() {
>     if(ajax_timeout) {
>       clearTimeout(ajax_timeout);
>     }
>   }
>
> });
>
> --Erik
>
> On 8/16/07, niner <[EMAIL PROTECTED]> wrote:
>
>
>
> > i would like to handle thetimeoutsituation with jQuery but could not
> > find a lot of information on that. i know you can specify
>
> >timeout:5000
>
> > as the ajax parameter. but what happens when it times out? i tried it
> > and it does not do anything. what i want is a simple alert() to show
> > when it times out in 5 seconds. how can i accomplish that?
>
> > thanks.

Reply via email to