-/**
- * Load HTML from a remote file and inject it into the DOM.
- *
- * @example $("#feeds").load("feeds.html")
- * @before <div id="feeds"></div>
- * @result <div id="feeds"><b>45</b> feeds found.</div>
- *
- * @name load
- * @type jQuery
- * @param String url The URL of the HTML file to load.
- * @param Hash params A set of key/value pairs that will be sent to the server.
- * @param Function callback A function to be executed whenever the data is loaded.
- * @cat AJAX
- */
-jQuery.fn.load = function( url, params, callback, ifModified ) {
- if ( url.constructor == Function )
- return this.bind("load", url);
-
- callback = callback || function(){};
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( params.constructor == Function ) {
- // We assume that it's the callback
- callback = params;
- params = null;
-
- // Otherwise, build a param string
- } else {
- params = jQuery.param( params );
- type = "POST";
+ /**
+ * Load HTML from a remote file and inject it into the DOM.
+ *
+ * @example $("#feeds").load("feeds.html")
+ * @before <div id="feeds"></div>
+ * @result <div id="feeds"><b>45</b> feeds found.</div>
+ *
+ * @example $("#feeds").load("feeds.html",
+ * {test: true},
+ * function() { alert("load is done"); }
+ * );
+ * @desc Same as above, but with an additional parameter
+ * and a callback that is executed when the data was loaded.
+ *
+ * @test stop();
+ * $('#first').load("data/name.php", function() {
+ * ok( $('#first').text() == 'ERROR', 'Check if content was injected into the DOM' );
+ * 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();
+ * });
+ *
+ * @test stop();
+ * window.foobar = undefined;
+ * window.foo = undefined;
+ * var verifyEvaluation = function() {
+ * ok( foobar == "bar", 'Check if script src was evaluated after load' );
+ * ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM');
+ * ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM');
+ * start();
+ * };
+ * $('#first').load('data/test.html', function() {
+ * ok( $('#first').html().match(/^html text/), 'Check content after loading html' );
+ * ok( foo == "foo", 'Check if script was evaluated after load' );
+ * setTimeout(verifyEvaluation, 600);
+ * });
+ *
+ * @name load
+ * @type jQuery
+ * @param String url The URL of the HTML file to load.
+ * @param Object params A set of key/value pairs that will be sent to the server.
+ * @param Function callback A function to be executed whenever the data is loaded.
+ * @cat AJAX
+ */
+ load: function( url, params, callback, ifModified ) {
+ if ( url.constructor == Function )
+ return this.bind("load", url);
+
+ callback = callback || function(){};
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params ) {
+ // If it's a function
+ if ( params.constructor == Function ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else {
+ params = jQuery.param( params );
+ type = "POST";
+ }