Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I use JavaScript inside a JSP page?

 
nan sh
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't find any official documentation to say I can do that.
 
nan sh
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Mika, my question actually is that if a page is written by jsp( means page name has .jsp as suffix and gota JSP code inside), can I insert any JavaScript inside this page too?
As JSP don't support onMove() or more, so I have to use JavaScript. Am I allow to do that?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSP writes HTML output to a browser as a response to a request. Anything you can put in a static HTML page can be written by a JSP. You may have to be careful about escaping characters, etc. but it can be done.
I get the feeling that you are a little mixed up about where things happen - Javascript executes on the browser, JSP executes on the server.
Bill
 
nan sh
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill and your books.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic