Removed all deprecated functionality for jQuery 1.2. A full list of what was removed can be found here: http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-for-12/
This commit is contained in:
parent
139393fe09
commit
53dc6afc31
6 changed files with 85 additions and 180 deletions
|
@ -1,10 +1,5 @@
|
|||
jQuery.fn.extend({
|
||||
// DEPRECATED
|
||||
loadIfModified: function( url, params, callback ) {
|
||||
this.load( url, params, callback, 1 );
|
||||
},
|
||||
|
||||
load: function( url, params, callback, ifModified ) {
|
||||
load: function( url, params, callback ) {
|
||||
if ( jQuery.isFunction( url ) )
|
||||
return this.bind("load", url);
|
||||
|
||||
|
@ -40,10 +35,9 @@ jQuery.fn.extend({
|
|||
url: url,
|
||||
type: type,
|
||||
data: params,
|
||||
ifModified: ifModified,
|
||||
complete: function(res, status){
|
||||
// If successful, inject the HTML into all the matched elements
|
||||
if ( status == "success" || !ifModified && status == "notmodified" )
|
||||
if ( status == "success" || status == "notmodified" )
|
||||
// See if a selector was specified
|
||||
self.html( selector ?
|
||||
// Create a dummy div to hold the results
|
||||
|
@ -69,12 +63,7 @@ jQuery.fn.extend({
|
|||
|
||||
serialize: function() {
|
||||
return jQuery.param( this );
|
||||
},
|
||||
|
||||
// DEPRECATED
|
||||
// This method no longer does anything - all script evaluation is
|
||||
// taken care of within the HTML injection methods.
|
||||
evalScripts: function(){}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
@ -88,7 +77,7 @@ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".sp
|
|||
var jsc = (new Date).getTime();
|
||||
|
||||
jQuery.extend({
|
||||
get: function( url, data, callback, type, ifModified ) {
|
||||
get: function( url, data, callback, type ) {
|
||||
// shift arguments if data argument was ommited
|
||||
if ( jQuery.isFunction( data ) ) {
|
||||
callback = data;
|
||||
|
@ -100,16 +89,10 @@ jQuery.extend({
|
|||
url: url,
|
||||
data: data,
|
||||
success: callback,
|
||||
dataType: type,
|
||||
ifModified: ifModified
|
||||
dataType: type
|
||||
});
|
||||
},
|
||||
|
||||
// DEPRECATED
|
||||
getIfModified: function( url, data, callback, type ) {
|
||||
return jQuery.get(url, data, callback, type, 1);
|
||||
},
|
||||
|
||||
getScript: function( url, callback ) {
|
||||
return jQuery.get(url, null, callback, "script");
|
||||
},
|
||||
|
@ -133,11 +116,6 @@ jQuery.extend({
|
|||
});
|
||||
},
|
||||
|
||||
// DEPRECATED
|
||||
ajaxTimeout: function( timeout ) {
|
||||
jQuery.ajaxSettings.timeout = timeout;
|
||||
},
|
||||
|
||||
ajaxSetup: function( settings ) {
|
||||
jQuery.extend( jQuery.ajaxSettings, settings );
|
||||
},
|
||||
|
|
|
@ -144,7 +144,7 @@ test("$.ajax - dataType html", function() {
|
|||
|
||||
foobar = null;
|
||||
testFoo = undefined;
|
||||
|
||||
|
||||
var verifyEvaluation = function() {
|
||||
ok( testFoo == "foo", 'Check if script was evaluated for datatype html' );
|
||||
ok( foobar == "bar", 'Check if script src was evaluated for datatype html' );
|
||||
|
@ -211,7 +211,6 @@ test("pass-through request object", function() {
|
|||
|
||||
/* Test disabled, too many simultaneous requests
|
||||
ok( $.get(url(target), success), "get" );
|
||||
ok( $.getIfModified(url(target), success), "getIfModified" );
|
||||
ok( $.post(url(target), success), "post" );
|
||||
ok( $.getScript(url("data/test.js"), success), "script" );
|
||||
ok( $.getJSON(url("data/json_obj.js"), success), "json" );
|
||||
|
@ -312,15 +311,6 @@ test("$.get(String, Hash, Function) - parse xml and use text() on nodes", functi
|
|||
});
|
||||
});
|
||||
|
||||
test("$.getIfModified(String, Hash, Function)", function() {
|
||||
expect(1);
|
||||
stop();
|
||||
$.getIfModified(url("data/name.html"), function(msg) {
|
||||
ok( /^ERROR/.test(msg), 'Check ifModified' );
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
||||
test("$.getScript(String, Function) - with callback", function() {
|
||||
expect(2);
|
||||
stop();
|
||||
|
@ -517,12 +507,12 @@ test("$.post(String, Hash, Function) - simple with xml", function() {
|
|||
});
|
||||
});
|
||||
|
||||
test("$.ajaxTimeout(Number) - with global timeout", function() {
|
||||
test("$.ajaxSetup({timeout: Number}) - with global timeout", function() {
|
||||
stop();
|
||||
|
||||
var passed = 0;
|
||||
|
||||
$.ajaxTimeout(1000);
|
||||
$.ajaxSetup({timeout: 1000});
|
||||
|
||||
var pass = function() {
|
||||
passed++;
|
||||
|
@ -548,11 +538,13 @@ test("$.ajaxTimeout(Number) - with global timeout", function() {
|
|||
});
|
||||
|
||||
// reset timeout
|
||||
$.ajaxTimeout(0);
|
||||
$.ajaxSetup({timeout: 0});
|
||||
});
|
||||
|
||||
test("$.ajaxTimeout(Number) with localtimeout", function() {
|
||||
stop(); $.ajaxTimeout(50);
|
||||
test("$.ajaxSetup({timeout: Number}) with localtimeout", function() {
|
||||
stop();
|
||||
$.ajaxSetup({timeout: 50});
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
timeout: 5000,
|
||||
|
@ -566,8 +558,9 @@ test("$.ajaxTimeout(Number) with localtimeout", function() {
|
|||
start();
|
||||
}
|
||||
});
|
||||
|
||||
// reset timeout
|
||||
$.ajaxTimeout(0);
|
||||
$.ajaxSetup({timeout: 0});
|
||||
});
|
||||
|
||||
test("$.ajax - simple get", function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue