JavaScript and jQuery are very useful tools in web application development and they are widely used in all most all web application development tools. But in JSF, the same JavaScript and jQuery libraries are not complied. What is the way to overcome this limitation?
Can I download from the internet JSF-specific jQuery and JavaScript libraries? JavaScript and jQuery libraries which are extensively used with other technologies can not be used without modifications in JSF and hence, it is difficult to use them in JSF Is there any solution to this?
Update: Actually, I'm using NetBeans IDE 6.9.1 to develop web applications in J.S.F in which Javascript can not be used with the same syntax as it is used with other technologies. For example, string concatenation can not be made using the + operator. It can be made using the operator & instead. Similarly, most of the logical operators need to be modified and so on.
I'm using NetBeans IDE 6.9.1 to develop web applications in J.S.F in which Javascript can not be used with the same syntax as it is used with other technologies.
First of all, it's JSF, not J.S.F.
For example, string concatenation can not be made using the + operator.
This is nonsense. Perhaps you're confusing JavaScript with EL.
It can be made using the operator
&
instead. Similarly, most of the logical operators need to be modified and so on...
That is indeed required if you write JavaScript code plain vanilla straight inside a XML based template, such as Facelets which uses XHTML. The characters <
, >
, &
, "
, etc are special characters in XML and should be escaped whenever you want to represent them as-is in XML. The normal practice is to just put that plain JS code inside its own .js
file which you include by <script>
or <h:outputScript>
. Otherwise you've to put it in ugly <![CDATA[
blocks. Please note that this problem is not specifically related to JSF, but to combining JavaScript with XML in general.