This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Moving javascript with scriptlets to a separate file 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 » Engineering » HTML, CSS and JavaScript
Bookmark "Moving javascript with scriptlets to a separate file" Watch "Moving javascript with scriptlets to a separate file" New topic
Author

Moving javascript with scriptlets to a separate file

Lavanya Mothilal
Ranch Hand

Joined: Dec 27, 2007
Posts: 30
Hi there,

I am trying to move a javascript present inside a JSP to a separate file. But the javascript doesnt work after moving because it contains some scriptlets . Is there a way which makes the javascript to work ?


Thanks,<br />Lavanya
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

Scriptlets will, of course, only be processed if they are in a JSP. Moving the JavaScript template text containing scriptlets to a .js file prevents the scriptlets from ever being processed.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Moving javascript with scriptlets to a separate file
 
Similar Threads
Placing HTML Element table of INPUT TEXT fields at specified location in the page at run time
Displaying javascript alerts by reading from ApplicationResources
Organizing/Modularizing Javascript in large JSP file
What are the advantages of using JavaScript inside a JSP and in a separate file?
JSP load time performance if there are lot of JS coding