Closed code0100fun closed 8 years ago
Seems bad. PR would be help.
I'm using jQuery 1.11.3 too and unfortunately I can't switch to jQuery 2.x :( Could you (Pretender developers), please, check jQuery 1.x support?
@trek any update on this one?
@code0100fun do you have a PR for this one?
I can't think of a clean way to tell when the user has an older version of jQuery without tying Pretender to jQuery in some way.
As a workaround, you may be able to wrap the onload
callback of FakeXMLHTTPRequest and call onreadystatechange
. That is what jQuery 1.x is using as a success callback.
It looks like onreadystatechange
is supposed to be called according to the spec. Maybe FakeXMLHTTPRequest should be calling _readyStateChange
here, but I'm not very familiar with the internals.
Any advice @trek or @mike-north ?
@code0100fun this is what i've done: https://github.com/pretenderjs/pretender/pull/114
addressed by #130
I can't get passthrough to work with jQuery 1.x. The requests are sent using
$.ajax('/path').then(...)
but thethen
callbacks are never fired.Seems like the
onload
event is detected on the browserxhr
but is not supported by the 1.x jQueryxhr
module, so it is not dispatched when the response is received.I was able to get the events to fire by removing the check for
onload
and just adding both events.There is a chance that both events could be fired I'm guessing. Any other concerns I should check into before getting a PR ready?