diff --git a/Makefile b/Makefile
index 935f69c12..f69aa6379 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,6 @@ BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/manipulation.js\
${SRC_DIR}/css.js\
${SRC_DIR}/ajax.js\
- ${SRC_DIR}/xhr.js\
${SRC_DIR}/transports/jsonp.js\
${SRC_DIR}/transports/script.js\
${SRC_DIR}/transports/xhr.js\
diff --git a/Rakefile b/Rakefile
index 5ea143b66..4d72a1c81 100644
--- a/Rakefile
+++ b/Rakefile
@@ -9,7 +9,7 @@ test_dir = File.join( prefix, 'test' )
# setting DIST_DIR before calling rake
dist_dir = ENV['DIST_DIR'] || File.join( prefix, 'dist' )
-base_files = %w{intro core support data queue attributes event selector traversing manipulation css ajax xhr transports/jsonp transports/script transports/xhr effects offset dimensions outro}.map { |js| File.join( src_dir, "#{js}.js" ) }
+base_files = %w{intro core support data queue attributes event selector traversing manipulation css ajax transports/jsonp transports/script transports/xhr effects offset dimensions outro}.map { |js| File.join( src_dir, "#{js}.js" ) }
# Sizzle, QUnit and jQuery files/dirs
sizzle_dir = File.join( src_dir, "sizzle" )
diff --git a/build.xml b/build.xml
index f6650f440..f2f805f41 100644
--- a/build.xml
+++ b/build.xml
@@ -63,7 +63,6 @@
-
diff --git a/src/ajax.js b/src/ajax.js
index 5c655b58c..9f8e2384e 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -1,12 +1,20 @@
(function( jQuery ) {
-var rscript = /
-
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 222dd9a38..85430eb82 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -74,7 +74,7 @@ test("jQuery.ajax() - success/error callbacks (remote)", function() {
var supports = jQuery.support.cors;
- expect( supports ? 9 : 6 );
+ expect( supports ? 9 : 4 );
jQuery.ajaxSetup({ timeout: 0 });
@@ -102,8 +102,8 @@ test("jQuery.ajax() - success/error callbacks (remote)", function() {
dataType: "text",
beforeSend: function(){ ok(supports, "beforeSend"); },
success: function( val ){ ok(supports, "success"); ok(supports && val.length, "data received"); },
- error: function(_ , a , b ){ ok(!supports, "error"); },
- complete: function(){ ok(true, "complete"); }
+ error: function(_ , a , b ){ ok(false, "error"); },
+ complete: function(){ ok(supports, "complete"); }
});
}, 13);
});
@@ -409,136 +409,6 @@ test("jQuery.ajax() - abort", function() {
equals( xhr.readyState, 0, "XHR readyState indicates successful abortion" );
});
-test("jQuery.ajax() - readyState (success)", function() {
- expect( 1 );
-
- jQuery.ajaxSetup({ timeout: 0 });
-
- stop();
-
- var control = "";
-
- setTimeout(function(){
- jQuery.ajax({
- url: url("data/name.html"),
- beforeSend: function( xhr ) {
- xhr.onreadystatechange = function() {
- control += xhr.readyState;
- }
- },
- complete: function(){
- setTimeout( function() {
- equals( control , "1234" , "onreadystatechange was properly called" );
- }, 13 );
- start();
- }
- });
- }, 13);
-});
-
-test("jQuery.ajax() - readyState (abort)", function() {
- expect( 2 );
-
- jQuery.ajaxSetup({ timeout: 0 });
-
- stop();
-
- var control = "";
-
- setTimeout(function(){
-
- jQuery.ajaxSetup({ timeout: 500 });
-
- jQuery.ajax({
- url: url("data/name.php?wait=5"),
- beforeSend: function( xhr ) {
- xhr.onreadystatechange = function() {
- control += xhr.readyState;
- }
- },
- complete: function( xhr ){
- setTimeout( function() {
- equals( control , "14" , "onreadystatechange was properly called" );
- equals( xhr.readyState, 0 , "readyState is 0" );
- }, 13 );
- start();
- }
- });
- }, 13);
-});
-
-test("jQuery.xhr() - reuse", function() {
- expect( 15 );
-
- jQuery.ajaxSetup({ timeout: 0 });
-
- stop();
-
- var number = 0;
-
- setTimeout(function(){
- jQuery('#foo').ajaxStart(function(){
- ok( true, "ajaxStart" );
- }).ajaxStop(function(){
- ok( true, "ajaxStop" );
- start();
- }).ajaxSend(function(){
- number++;
- ok( true, "ajaxSend (" + number +")" );
- }).ajaxComplete(function(){
- ok( true, "ajaxComplete (" + number +")" );
- }).ajaxError(function(){
- ok( false, "ajaxError (" + number +")" );
- }).ajaxSuccess(function(){
- ok( true, "ajaxSuccess (" + number +")" );
- });
-
- jQuery.ajax({
- url: url("data/name.html"),
- beforeSend: function(){ ok(true, "beforeSend (1)"); },
- success: function( _1 , _2 , xhr ){
- ok(true, "success (1)");
- xhr.complete(function() {
- ok(true, "complete (1bis)");
- });
- xhr.open( "GET", url("data/name.html") );
- xhr.success( function(){ ok(true, "beforeSend (2)"); } )
- xhr.send( null, {
- success: function(){ ok(true, "success (2)"); },
- error: function(){ ok(false, "error (2)"); },
- complete: function(){ ok(true, "complete (2)"); }
- } );
- },
- error: function(){ ok(false, "error (1)"); },
- complete: function(){ ok(true, "complete (1)"); }
- });
- }, 13);
-});
-
-test("jQuery.xhr() - early binding", function() {
- expect( 2 );
-
- jQuery.ajaxSetup({ timeout: 0 });
-
- stop();
-
- jQuery.xhr()
- .success( function(){ ok(true, "success"); } )
- .error( function(){ ok(false, "error"); } )
- .complete( function(){ ok(true, "complete"); start(); } )
- .open( "GET", url("data/name.html") )
- .send();
-});
-
-test("jQuery.xhr() - get native implementation", function() {
-
- var xhr = jQuery.xhr(true);
-
- ok( xhr.readyState !== undefined , "implements XMLHttpRequest" );
- ok( ! jQuery.isFunction( xhr.success ) , "is not jQuery's abstraction" );
-
-});
-
test("Ajax events with context", function() {
expect(14);
@@ -653,34 +523,6 @@ test("jQuery.ajax() - disabled globals", function() {
});
});
-test("jQuery.xhr() - disabled globals through xhr.send(data , false)", function() {
- expect( 2 );
- stop();
-
- jQuery('#foo').ajaxStart(function(){
- ok( false, "ajaxStart" );
- }).ajaxStop(function(){
- ok( false, "ajaxStop" );
- }).ajaxSend(function(){
- ok( false, "ajaxSend" );
- }).ajaxComplete(function(){
- ok( false, "ajaxComplete" );
- }).ajaxError(function(){
- ok( false, "ajaxError" );
- }).ajaxSuccess(function(){
- ok( false, "ajaxSuccess" );
- });
-
- jQuery.xhr()
- .success(function(){ ok(true, "success"); })
- .error(function(){ ok(false, "error"); })
- .complete(function(){
- ok(true, "complete");
- setTimeout(function(){ start(); }, 13);
- })
- .open("GET", url("data/name.html")).send(undefined, false);
-});
-
test("jQuery.ajax - xml: non-namespace elements inside namespaced elements", function() {
expect(3);
stop();