<pclass="arguement"><strong>url</strong>A string containing the URL to which the request is sent.</p>
<pclass="arguement"><strong>success(data, textStatus)</strong>A callback function that is executed if the request succeeds.</p>
</li></ul>
<divclass="longdesc">
<p>This is a shorthand Ajax function, which is equivalent to:</p>
<pre>$.ajax({
url: <em>url</em>,
dataType: 'script',
success: <em>success</em>
});
</pre>
<p>The callback is passed the returned JavaScript file. This is generally not useful as the script will already have run at this point.</p>
<p>The script is executed in the global context, so it can refer to other variables and use jQuery functions. Included scripts should have some impact on the current page:</p>
<pre>$('.result').html('<p>Lorem ipsum dolor sit amet.</p>');</pre>
<p>The script can then be included and run by referencing the file name:</p>
<pre>$.getScript('ajax/test.js', function() {
alert('Load was performed.');
});</pre>
</div>
<h3>Examples:</h3>
<divid="entry-examples"class="entry-examples">
<divid="example-0">
<h4>Example: <spanclass="desc">We load the new official jQuery Color Animation plugin dynamically and bind some color animations to occur once the new functionality is loaded.</span>