As you know primefaces include by default jquery libs but I noticed that many primefaces developers need to add Customed jQuery in there Primefaces Jsf pages but they don't know how .
to use jQuery script with Primefaces Jsf you need to import it like that in the <h:head></h:head> :
and in your jQuery script you need to start it with //<![CDATA[ and to end it with //]]>
Example :
to use jQuery script with Primefaces Jsf you need to import it like that in the <h:head></h:head> :
<script type="text/javascript" src="./js/ui3.js"/>
and in your jQuery script you need to start it with //<![CDATA[ and to end it with //]]>
Example :
//<![CDATA[
$( init );
function init() {
(function($){
var sortOpts = {
connectWith: ["#sortablesA", "#sortablesB"]
};
$("#sortablesA, #sortablesB").sortable(sortOpts);
})(jQuery);
}
//]]>
No comments:
Post a Comment