Re: Javascript / Jquery dont' work

Splash Forums PrettyFaces Users Javascript / Jquery dont' work Re: Javascript / Jquery dont' work

#20613

rafaeltc
Participant

Hey Lucas. You should do what Christian told you to. You cannot import jquery.js using primeFaces because it already does it for you.

You can just use the jQuery functions you want with no problems, unless if you want to use a different version of jQuery. And that would be a problem.

Also, when using jQuery plugins together with primeFaces, before calling the jQuery functions, you should do the following:

1- use jQuery.noConflict();

2- switch all the $ you have in your functions calls to “jQuery”

Example:

if you have the code $(‘#menu ul’).hide();

you should do:

jQuery.noConflict();

jQuery(‘#menu ul’).hide();

the noConflict needs to be called only once!

This will avoid coflicts among the 2 libs functions.

BTW, I am Brazilian too! o/