Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
9
rated 0 times [  10] [ 1]  / answers: 1 / hits: 19344  / 13 Years ago, wed, january 18, 2012, 12:00:00

I'm trying to run some basic javascript code with JSF 2.
I'm using the following code to do so:



<h:outputScript target=head>
var props = $.event.props;
</h:outputScript>


Looking at the source of the page I can't find any evidence of this code.
I thought that was the correct way to work with javascript code in JSF.
Should I use the <script> tag of html instead?



Thanks!


More From » jsf

 Answers
10

That's not the intend purpose of the outputScript tag. It just renders an HTML script tag while resolving the location of the javascript file that's specified in its name attribute.



If you need to inline javascript, just enclose it in the <script> tag directly.


[#87937] Tuesday, January 17, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mitchellg

Total Points: 235
Total Questions: 117
Total Answers: 106

Location: Fiji
Member since Wed, Jul 14, 2021
3 Years ago
;