Bug Tracker

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#14379 closed bug (fixed)

Issue with xhr.js

Reported by: Sabran Owned by: gibson042
Priority: undecided Milestone: 1.11/2.1
Component: ajax Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

I’m trying to use the latest version of jQuery and the latest version of jquery.signalR. I’m running into a problem in IE9 specifically. On window.unload, signalR is firing off an AJAX request. This fails in jquery with the error: Unable to set value of the property 'x': object is null or undefined. The ‘x’ is actually a number, but it varies.

I’ve traced the issue down to line 104 in xhr.js:

callback = xhrCallbacks[( id = xhrId++ )] = callback("abort");

The problem is that xhrCallbacks is undefined at the time of this call. The reason it is undefined is because earlier, on line 32, it is explicitly set to undefined on the window.unload event.

Change History (10)

comment:1 follow-up: Changed 3 years ago by Sabran

Since this is a problem related to window.unload being called, I don't think it's reproducible using jsFiddle. Sorry.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 3 years ago by gibson042

  • Owner set to Sabran
  • Status changed from new to pending

Replying to Sabran:

Since this is a problem related to window.unload being called, I don't think it's reproducible using jsFiddle. Sorry.

I recommend a reduced test case that either manually triggers "unload" or leverages iframes.

comment:3 in reply to: ↑ 2 Changed 3 years ago by Sabran

  • Status changed from pending to new

Ok. Here's the jsFiddle which manually triggers unload:

http://jsfiddle.net/wE3YU/3/

Thanks!

comment:4 Changed 3 years ago by Sabran

Just a reminder, I'm only able to reproduce the error in IE9. It seems to work fine in Chrome and Firefox.

comment:5 Changed 3 years ago by Sabran

Is there anything else needed from me to verify that this is a legitimate issue with jQuery?

comment:6 Changed 3 years ago by gibson042

  • Owner changed from Sabran to gibson042
  • Status changed from new to assigned

No; that'll do. Thanks!

comment:7 Changed 3 years ago by anonymous

Any ETA on when this might get prioritized?

comment:8 Changed 3 years ago by gibson042

  • Milestone changed from None to 1.11/2.1

comment:9 Changed 3 years ago by Richard Gibson

  • Resolution set to fixed
  • Status changed from assigned to closed

Fix #14379: AJAX requests on unload

Changeset: f9d41ac641dcb5a93ba8a9027476b160d8f41111

comment:10 Changed 2 years ago by dmethvin

  • Component changed from unfiled to ajax
Note: See TracTickets for help on using tickets.