Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've run into this one before — jQuery isn't "defined" when jQuery UI begins to load. Yes, this can be true even if jQuery is loading it! ;-)</p> <p>The jQuery UI script takes the <em>global name</em> <code>jQuery</code> as its first argument. You aren't loading jQuery UI until after you've called <code>jQuery.noConflict(true)</code>, which removes jQuery from the global object (<code>window</code>).</p> <p>There are two ways to solve this. If you're okay leaving <code>window.jQuery</code> intact, simply remove the <code>true</code> from your <code>noConflict</code> call; this relinquishes control over <code>$</code> but leaves <code>jQuery</code> around for jQuery UI to use:</p> <pre><code>/******** Called once jQuery has loaded ******/ function scriptLoadHandler() { // Restore $ to its previous values and store the // new jQuery in our local jQuery variable jQuery = window.jQuery.noConflict(); // no argument! // Call our main function main(); } </code></pre> <p>Alternatively, move your <code>noConflict</code> call into a callback on <code>getScript</code>:</p> <pre><code>/******** Called once jQuery has loaded ******/ function scriptLoadHandler() { // Store jQuery in a local variable so it can be removed later jQuery = window.jQuery; // Call our main function main(); } /******** Our main function ********/ function main() { // Add some validation here to make sure UI is not loaded etc... jQuery.getScript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js', function() { jQuery.noConflict(true); }); // ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload