#987 bug
jwind

activeRequestCount fails to decrement on IE 7/8 (didn't test other IE versions)

Reported by jwind | February 5th, 2010 @ 11:26 PM

I noticed that activeRequestCount was often failing to decrement to 0 in IE 7 and 8. Primarily this is when I'm using Scriptaculous Autocompleters. I have not been able to reproduce this in FF or Chrome.

After some investigation, I determined that all AJAX calls had completed, but onComplete responder was not always being called every time by respondToReadyState. When it failed to call onComplete, it was because attempting to execute the line

  (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);

would cause the exception "'style' is null or not an object" to be thrown, and the following line that would have called onComplete to decrement activeRequestCount would not run

  Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);

To make sure that the Ajax responders are called, I have moved this second line out to its own try/catch block and now IE 7 and 8 appear to reliably call the onComplete responder to decrement activeRequestCount to 0 when all requests have been completed.

//this block may sometimes fail in IE 7/8
try {
  (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
} catch (e) {
  this.dispatchException(e);
}

try {
  Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
} catch (e) {
  this.dispatchException(e);
}

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Pages