*
The moose likes JSF and the fly likes Javascript with JSF(.xhtml) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Javascript with JSF(.xhtml)" Watch "Javascript with JSF(.xhtml)" New topic
Author

Javascript with JSF(.xhtml)

David Lidz
Greenhorn

Joined: Mar 30, 2011
Posts: 14
Ive been trying to create javascript for xhtml pages but I just cant. The scripts work perfectly on html pages but I cant get them to work on xhtml pages.
Is there soemthing im missing? I presume that javascript has to be declared differently on xhtml pages.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

What you actually mean is that you're having problems with Facelets. Your best bet is to embed the JavaScript in "verbatim" tags. Or even better, put the JavaScript in its own file and have the xhtml view do an "include" of that file.


Customer surveys are for companies who didn't pay proper attention to begin with.
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
Even better, actually post up what doesn't work.
Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 219

Try the code below for your JavaScript codes inside .xhtml pages



Tuna TÖRE


blog: http://tunatore.wordpress.com
SCJP 6.0 + SCWCD 1.5
 
wood burning stoves
 
subject: Javascript with JSF(.xhtml)
 
Similar Threads
Help for a noob
Help with Tomcat XML
Anchor Tag passing an input variable
Regarding HTML Form
SEO and AJAX