Ticket #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: | ||
| Blocking: | Blocked by: |
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
comment:2 in reply to: ↑ 1 ; follow-up: ↓ 3 Changed 5 months 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:4 Changed 5 months 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 5 months ago by Sabran
Is there anything else needed from me to verify that this is a legitimate issue with jQuery?
comment:6 Changed 5 months ago by gibson042
- Owner changed from Sabran to gibson042
- Status changed from new to assigned
No; that'll do. Thanks!
comment:9 Changed 4 months ago by Richard Gibson
- Status changed from assigned to closed
- Resolution set to fixed
Fix #14379: AJAX requests on unload
Changeset: f9d41ac641dcb5a93ba8a9027476b160d8f41111
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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