Does jQuery load() send any data even when the requested element is not found?

javascript, jquery

Solution

A quick test in firebug on this page shows that it does not send the request if the element doesn't exist.

I've verified this from the source (v1.8.3), which contains the following:

jQuery.fn.load = function( url, params, callback ) {
    // [snip]

    // Don't do a request if no elements are being requested
    if ( !this.length ) {
        return this;
    }

    // [snip]
}

Problem

When I have a code like this: ``` $('#intro-posts-container').load('/ajax/load.php', function() { bindVoting(); }); ``` Does the load send the request to load.php, if the `#intro-posts-container` element doesn't exist?

Original source