• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP - JavaScript

 
hsyn rtkn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
how i can call javascript from jsp
for ex:


output : abc

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP runs on the server in order to send the HTML file to the browser, where the JavaScript is executed.

Please read this article to understand how JSP operates.
 
zhiquan mai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hsyn rtkn wrote:hi,
how i can call javascript from jsp
for ex:


output : abc

Affter the JSP servlet initialize




 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cant call JS from JSP... Servlet container processes the request and sends the response... If you have embedded Script tag in response, it will also be sent along with the HTML response... thats all..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zhiquan mai wrote:Affter the JSP servlet initialize

This does not call JavaScript from JSP. Please read the article again,
 
kevin hao
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey.it's not gona work.first the jsp code called in server side. and javascript code called in client side.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!