Good question. No, ajaxStop isn't being fired when I call abort. I used
this to test:

$().ajaxStop( function() { alert('foo!'); } ); 

The alert appeared normally when I allowed the request to complete, but
if I hit cancel (calling the abort method), the block UI overlay stayed
and the alert did not appear.

As for onreadystatechange, I'm not too familiar with it, but I see it is
a property of the xhr object. Instead of calling abort, I tried having
the "cancel" event log xhr.onreadystatechange in the Firebug console,
and it was null. Trying to log it from ajaxStart doesn't work either,
since the xhr object doesn't exist yet.

m.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Alsup
Sent: Thursday, April 12, 2007 4:45 PM
To: [EMAIL PROTECTED]
Subject: [jQuery] Re: Block UI plugin not unblocking on xhr.abort() ?


Hi Matt,

Is ajaxStop getting invoked when you call abort?  What about
onreadystatechange, does it get invoked on an abort?

Mike



On 4/12/07, Matt Grimm <[EMAIL PROTECTED]> wrote:
>
>
> One thing I forgot to add:
>
> The block UI overlay *does* go away if I explicitly call $.unblockUI()
in
> the Firebug console after the block message gets stuck (from the
xhr.abort()
> call).
>
>  ________________________________
>  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
> Behalf Of Matt Grimm
> Sent: Thursday, April 12, 2007 4:17 PM
> To: [EMAIL PROTECTED]
> Subject: [jQuery] Block UI plugin not unblocking on xhr.abort() ?
>
>
>
> Mike (or others):
>
> I've recently upgraded my jQuery core and block UI code to the most
recent
> versions and have noticed something is not working the way it did
before.
>
> I'm using the default settings recommended on your web site to block
and
> unblock the UI:
>
> $().ajaxStart( $.blockUI ).ajaxStop( $.unblockUI );
>
>
> When I make an ajax call with $.ajax, I assign the XMLHttpRequest
object
> that is returned to a variable so I can call the abort() method on it
if the
> user clicks "cancel" within the block UI dialog I use. For example:
>
> var xhr = $.ajax( { url: '/test.htm' } );
>
> While that's loading, I call xhr.abort() to kill the request. That bit
still
> works, but the block UI overlay never goes away. Is this a bug,
by-design
> behavior, something else? I get the same result from Firefox 2.0, IE 6
and
> IE 7.
>
> Thanks for any help you can provide,
>
> m.

Reply via email to