Change the jquery version used in richfaces

I am using richfaces 3_3_3.Final and I will not use the latest jQuery http://code.jquery.com/jquery-latest.pack.js, but it seems to have conflicts.

Richfaces is already loading the jQuery version (after all, this is not a suitable version, it seems 1.3.2):

<script type="text/javascript" src="/project/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/jquery/jquery.js.jsf">

Is it possible to use the latest version for my Javascript process and allow RichFaces to use its own version and how?

Is jQuery.noConflict () a good area of ​​research?

+5
source share
1 answer

Yes, it jQuery.noConflict's a good start, but since the “other library” you are using, jQuery is also likely to have complications.

jQuery $ jQuery . .noConflict " $", , $, . v1.3.2, (1.6.4 ), .noConflict $ v1.3.2, jQuery - 1.6.4.

, jQuery, . , ( ).

<script type="text/javascript">
    //alias v.1.3.2
    var $132 = $;
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script type="text/javascript">
    //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
</script>

1.6.4 $ jQuery 1.3.2. .noConflict, . RichFaces 1.3.2, 1.6.4. $164 $. , . , .


, jquery-latest.pack.js, -. , - jQuery . , , . , , , .

+6

All Articles