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 201636d..697365a 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(" ");