Bug Tracker

Opened 4 years ago

Closed 4 years ago

Last modified 4 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 Changed 4 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 ; Changed 4 years ago by gibson042

Owner: set to Sabran
Status: newpending

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 4 years ago by Sabran

Status: pendingnew

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

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

Thanks!

comment:4 Changed 4 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 4 years ago by Sabran

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

comment:6 Changed 4 years ago by gibson042

Owner: changed from Sabran to gibson042
Status: newassigned

No; that'll do. Thanks!

comment:7 Changed 4 years ago by anonymous

Any ETA on when this might get prioritized?

comment:8 Changed 4 years ago by gibson042

Milestone: None1.11/2.1

comment:9 Changed 4 years ago by Richard Gibson

Resolution: fixed
Status: assignedclosed

Fix #14379: AJAX requests on unload

Changeset: f9d41ac641dcb5a93ba8a9027476b160d8f41111

comment:10 Changed 4 years ago by dmethvin

Component: unfiledajax
Note: See TracTickets for help on using tickets.