Added a check to make sure that a load request isn't done if the element doesn't exist. Fixes #4235.
This commit is contained in:
parent
c2101245c0
commit
357e2ae989
1 changed files with 4 additions and 0 deletions
|
@ -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(" ");
|
||||||
|
|
Loading…
Add table
Reference in a new issue