<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>success(data, textStatus, XMLHttpRequest)</strong>A callback function that is executed if the request succeeds.</p>
<pclass="arguement"><strong>dataType</strong>The type of data expected from the server.</p>
</li></ul>
<divclass="longdesc">
<p>This is a shorthand Ajax function, which is equivalent to:</p>
<pre>$.ajax({
type: 'POST',
url: <em>url</em>,
data: <em>data</em>,
success: <em>success</em>
dataType: <em>dataType</em>
});
</pre>
<p>The <code>success</code> callback function is passed the returned data, which will be an XML root element or a text string depending on the MIME type of the response. It is also passed the text status of the response.</p>
<p>As of jQuery 1.4, the <code>success</code> callback function is also passed the XMLHttpRequest object.</p>
<p>Most implementations will specify a success handler:</p>
<pre>$.post('ajax/test.html', function(data) {
$('.result').html(data);
});
</pre>
<p>This example fetches the requested HTML snippet and inserts it on the page.</p>
<p>Pages fetched with <code>POST</code> are never cached, so the <code>cache</code> and <code>ifModified</code> options in <code><ahref="/jQuery.ajaxSetup">jQuery.ajaxSetup()</a></code> have no effect on these requests.</p>
</div>
<h3>Examples:</h3>
<divid="entry-examples"class="entry-examples">
<divid="example-0">
<h4>Example: <spanclass="desc">Request the test.php page, but ignore the return results.</span>
<h4>Example: <spanclass="desc">Alert out the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned).</span>
<h4>Example: <spanclass="desc">Gets the test.php page content, store it in a XMLHttpResponse object and applies the process() JavaScript function.</span>