Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Have a read of this: <a href="http://docs.jquery.com/Using_jQuery_with_Other_Libraries" rel="noreferrer">http://docs.jquery.com/Using_jQuery_with_Other_Libraries</a></p> <p>Shows good examples :)</p> <p><strong>OVERRIDING THE $-FUNCTION</strong></p> <p>However, you can override that default by calling jQuery.noConflict() at any point after jQuery and the other library have both loaded. For example:</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;script src="prototype.js"&gt;&lt;/script&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; jQuery.noConflict(); // Use jQuery via jQuery(...) jQuery(document).ready(function(){ jQuery("div").hide(); }); // Use Prototype with $(...), etc. $('someid').hide(); &lt;/script&gt; &lt;/head&gt; &lt;body&gt;&lt;/body&gt; &lt;/html&gt; </code></pre> <p>This will revert $ back to its original library. You'll still be able to use "jQuery" in the rest of your application.</p> <p>Additionally, there's another option. If you want to make sure that jQuery won't conflict with another library - but you want the benefit of a short name, you could do something like this:</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;script src="prototype.js"&gt;&lt;/script&gt; &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; var $j = jQuery.noConflict(); // Use jQuery via $j(...) $j(document).ready(function(){ $j("div").hide(); }); // Use Prototype with $(...), etc. $('someid').hide(); &lt;/script&gt; &lt;/head&gt; &lt;body&gt;&lt;/body&gt; &lt;/html&gt; </code></pre>
 

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