<pclass="arguement"><strong>url</strong>A string containing the URL to which the request is sent.</p>
<pclass="arguement"><strong>data</strong>A map or string that is sent to the server with the request.</p>
<pclass="arguement"><strong>complete(responseText, textStatus, XMLHttpRequest)</strong>A callback function that is executed when the request completes.</p>
</li></ul>
<divclass="longdesc">
<p>This method is the simplest way to fetch data from the server. It is roughly equivalent to <code>$.get(url, data, success)</code> except that it is a method rather than global function and it has an implicit callback function. When a successful response is detected (i.e. when <code>textStatus</code> is "success" or "notmodified"), <code>.load()</code> sets the HTML contents of the matched element to the returned data. This means that most uses of the method can be quite simple:</p>
<pre>$('#result').load('ajax/test.html');</pre>
<p>The provided callback, if any, is executed after this post-processing has been performed:</p>
<p>In the two examples above, if the current document does not contain an element with an ID of "result," the <code>.load()</code> method is not executed.</p>
<p>The POST method is used if data is provided as an object; otherwise, GET is assumed.</p>
<blockquote><p>Note: The event handling suite also has a method named <code><ahref="/load-event">.load()</a></code>. Which one is fired depends on the set of arguments passed.</p></blockquote>
<h4>Loading Page Fragments</h4>
<p>The <code>.load()</code> method, unlike <code><ahref="/jQuery.get">$.get()</a></code>, allows us to specify a portion of the remote document to be inserted. This is achieved with a special syntax for the <code>url</code> parameter. If one or more space characters are included in the string, the portion of the string following the first space is assumed to be a jQuery selector that determines the content to be loaded. </p>
<p>We could modify the example above to fetch only part of the document:</p>
<p>When this method executes, it retrieves the content of <code>ajax/test.html</code>, but then jQuery parses the returned document to find the element with an ID of <code>container</code>. This element, along with its contents, is inserted into the element with an ID of <code>result</code>, and the rest of the retrieved document is discarded.</p>
</div>
<h3>Examples:</h3>
<divid="entry-examples"class="entry-examples">
<divid="example-0">
<h4>Example: <spanclass="desc">Load the main page's footer navigation into an ordered list.</span>
<h4>Example: <spanclass="desc">Same as above, but will POST the additional parameters to the server and a callback that is executed when the server is finished responding.</span>