Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, <code>jQuery.noConflict</code> is a good start, but since the "other library" you are using is also jQuery, there will probably be complications. </p> <p>When you load jQuery, it defines <code>$</code> and <code>jQuery</code> as global variables. Using <code>.noConflict</code> will "relinquish control of the <code>$</code> variable" - meaning whatever <code>$</code> was before, it will be set to again. If v1.3.2 is loaded first and you load latest pack (1.6.4 as of right now) next, <code>.noConflict</code> will make <code>$</code> refer to v1.3.2 but <code>jQuery</code> will still refer to 1.6.4.</p> <p>Basically, you need to alias jQuery before you load the latest pack. <a href="http://jsfiddle.net/RHMWH/1/">See my fiddle used to simulate your situation</a> (also pasted below).</p> <pre><code>&lt;script type="text/javascript"&gt; //alias v.1.3.2 var $132 = $; &lt;/script&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //alias v1.6.4 var $164 = $, jQuery164 = $; //reset original variables to v1.3.2 $ = jQuery = $132; console.log("v1.3.2: ", $().jquery, jQuery().jquery) console.log("v1.6.4: ", $164().jquery, jQuery164().jquery) $('div') //selected using v1.3.2 $164('div') //selected using v1.6.4 &lt;/script&gt; </code></pre> <p>After loading 1.6.4, you need to alias it and set <code>$</code> and <code>jQuery</code> back to the 1.3.2 objects. This doesnt use <code>.noConflict</code> becuase it essentially does the same thing. RichFaces will continue to work using 1.3.2 and you will write your code against the aliased 1.6.4 version. In my fiddle, that means using <code>$164</code> instead of using <code>$</code>. I hope that makes sense. I am sure the fiddle will be clearer.</p> <hr> <p>Finally, it is fine to develop code using <code>jquery-latest.pack.js</code> but you shouldn't ever use that on your production website. The reason is because at some point in the future, jQuery will be updated. If you are loading the latest pack, those updates may break the functionality of your site without you even knowing it. It's safer to just pick a version and stick to it, only upgrading only when you confirmed that your site will continue to function properly.</p>
    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