Re: Javascript / Jquery dont' work

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

#20610

Hey lucasmurata,

here a few notes on your problem.

1. It seems like you want to manually add jQuery to your page. I don’t think this is a good idea as PrimeFaces already includes jQuery. If your are using a different version of jQuery than PrimeFaces this may get a problem.

2. I recommend to always use absolute URLs when loading CSS or Javascript. Use something like:

<script type="text/javascript" src="#{request.contextPath}/js/jquery.js" />

3. You should restrict your rewrite rules to match only desired pages. If you add a rewrite rules without or with a very general pattern all request (even resources loaded by PrimeFaces/JSF) will be rewritten. This may not be what you want as it may break PrimeFaces.

I hope this helps

Christian