Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

SC.XHRResponse doesn't get notified of state changes in IE 8 #866

Closed
rcatalano opened this Issue · 4 comments

3 participants

@rcatalano

Looks to be due to the addition of the else if(window.XMLHttpRequest) in invokeTransport. SC.Event.add doesn't actually add the readyStateChange handler to the raw request.

Simple fix: remove the else if. Not sure if this will break things though.

@dcporter
Owner

Code in question is here:

https://github.com/sproutcore/sproutcore/blob/master/frameworks/ajax/system/response.js

on line 552. Looks like commit bc0b8fc (adding support for XHR2) added the offending else if; I guess IE8 has window.XMLHttpRequest but SC.Event is failing to add the handler there. Anyone know what IE8 event handler weirdness could cause this?

Options:

  • Improve SC.Event
  • Improve the else if so it fails over to the following else in IE8
@dcporter
Owner

@rcatalano reports that the problem is that in IE8, the rawRequest object has neither addEventListener nor attachEvent methods, so SC.Event.add will fail. Sounds like the solution is to check for (rawRequest.addEventListener || rawRequest.attachEvent) on line 552 and fail over to the below "else" if neither are present.

@publickeating

Any chance we could get a pull request please?

@publickeating

Fixed in 1-9-stable and master branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.