Skip to content

Commit

Permalink
Added a check to make sure that a load request isn't done if the elem…
Browse files Browse the repository at this point in the history
…ent doesn't exist. Fixes #4235.
  • Loading branch information
jeresig committed Nov 11, 2009
1 parent c210124 commit 357e2ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ajax.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jQuery.fn.extend({
load: function( url, params, callback ) { load: function( url, params, callback ) {
if ( typeof url !== "string" ) { if ( typeof url !== "string" ) {
return this._load( url ); 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(" "); var off = url.indexOf(" ");
Expand Down

0 comments on commit 357e2ae

Please sign in to comment.