Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Many JavaScript libraries use <strong>$</strong> as a function or variable name, just as jQuery does. In jQuery's case, <strong>$</strong> is just an alias for <strong>jQuery</strong>, so all functionality is available without using <strong>$</strong> . followings are some methods :</p> <ul> <li><p>Write <code>jQuery.noConflict();</code> before initialization of jQuery,see below </p> <pre><code>jQuery.noConflict(); $(document).ready(function(){ // your jQuery code }); </code></pre></li> <li><p>Create a different alias instead of jQuery to use in the rest of the script. </p> <pre><code> var j = jQuery.noConflict(); // Do something with jQuery j("div p").hide(); </code></pre></li> <li><p>Change all instance of <strong>$</strong> : Replace <code>$</code> with <code>jQuery</code> in jQuery code block </p> <pre><code> jQuery(document).ready(function){ jQuery("div p").hide(); }) </code></pre></li> <li><p>Completely move jQuery to a new namespace in another object. </p> <pre><code>var dom = {}; dom.query = jQuery.noConflict(true); // Do something with the new jQuery dom.query("div p").hide(); </code></pre></li> <li><p>Set scope of <strong>$</strong> to local instead of global</p> <pre><code> // Method 1 jQuery(document).ready(function($){ $("div").hide(); }); // Method 2 (function($) { /* some code that uses $ */ })(jQuery); </code></pre> <p><strong>Note :</strong> this point comes with one drawback, you will not have access to your other library's <strong>$()</strong> method. </p></li> </ul> <p><a href="http://api.jquery.com/jQuery.noConflict/" rel="nofollow"><code>Original Reference</code></a></p>
    singulars
    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. 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.
    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