]> source.dussan.org Git - jquery.git/commitdiff
Added a check to make sure that a load request isn't done if the element doesn't...
authorJohn Resig <jeresig@gmail.com>
Wed, 11 Nov 2009 19:55:32 +0000 (14:55 -0500)
committerJohn Resig <jeresig@gmail.com>
Wed, 11 Nov 2009 19:55:32 +0000 (14:55 -0500)
src/ajax.js

index 201636dfa2509756083088eac3c6e46682bcd491..697365a2ff232bb94fa79654e7ea12f5ba5e055f 100644 (file)
@@ -15,6 +15,10 @@ jQuery.fn.extend({
        load: function( url, params, callback ) {
                if ( typeof url !== "string" ) {
                        return this._load( url );
+
+               // Don't do a request if no elements are being requested
+               } else if ( !this.length ) {
+                       return this;
                }
 
                var off = url.indexOf(" ");