I've created a plug-in that duck-punches the jQuery Ajax function. One problem that I cannot locate when running the Ajax unit tests for 1.4.2 It will not pass the two tests
- Ajax events with context
- jQuery.ajax context modification
Test one has a test that always fails:
function callback(msg){
return function(){
equals( this, context, "context is preserved on callback " + msg );
};
}
The this
reference instead of being the <div/>
tag becomes an XPC Cross Origin Wrapper.
My unit tests for the plug-in can be run here:
The failing unit tests can be run here:
One note is that jQuery 1.4.2 Ajax doe not handle a server response of 301 with FireFox 3.6.8. It will be returned as 0. I've modified my jQuery Library to account for this.
Also some JSONP stop watch timing. BUG #5383.
And maybe some presentation issues and this plug-in will be ready for the wild.
Any help would be appreciated. including design. Thanks in advance.