X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fajax%2Fajax.js;h=896f92d2f48e0189741b8e0e97fdf33bc832af96;hb=967eec18317d0451af93b1a86902e80d39086507;hp=1f01553f72cf90c4bf2854d33535ca873d39f4ff;hpb=ad2a6bd91626efbaf9509c9643c60679b1fab942;p=jquery.git diff --git a/src/ajax/ajax.js b/src/ajax/ajax.js index 1f01553..896f92d 100644 --- a/src/ajax/ajax.js +++ b/src/ajax/ajax.js @@ -39,6 +39,13 @@ jQuery.fn.extend({ * start(); * }); * + * @test stop(); // check if load can be called with only url + * $('#first').load("data/name.php"); + * $.get("data/name.php", function() { + * ok( $('#first').text() == 'ERROR', 'Check if load works without callback'); + * start(); + * }); + * * @name load * @type jQuery * @param String url The URL of the HTML file to load. @@ -80,9 +87,9 @@ jQuery.fn.extend({ self.html(res.responseText).each( callback, [res.responseText, status] ); // Execute all the scripts inside of the newly-injected HTML - $("script", self).each(function(){ + jQuery("script", self).each(function(){ if ( this.src ) - $.getScript( this.src ); + jQuery.getScript( this.src ); else eval.call( window, this.text || this.textContent || this.innerHTML || "" ); }); @@ -117,7 +124,7 @@ jQuery.fn.extend({ * @cat AJAX */ serialize: function() { - return $.param( this ); + return jQuery.param( this ); } }); @@ -281,19 +288,6 @@ jQuery.extend({ * } * ) * - * @test stop(); - * $.get("data/dashboard.xml", function(xml) { - * var content = []; - * $('tab', xml).each(function(k) { - * // workaround for IE needed here, $(this).text() throws an error - * // content[k] = $.trim(this.firstChild.data) || $(this).text(); - * content[k] = $(this).text(); - * }); - * ok( content[0] && content[0].match(/blabla/), 'Check first tab' ); - * ok( content[1] && content[1].match(/blublu/), 'Check second tab' ); - * start(); - * }); - * * @name $.get * @type jQuery * @param String url The URL of the page to load.