• Post Reply Bookmark Topic Watch Topic
  • New Topic

using jsp inside a javascript function  RSS feed

 
pravin badiyavadra
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i use jsp coding inside a javascript function?

main problem is

i want to perform dataconnection when user press on a button(other than submit)

please give suggession
 
Ajith George
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ofcourse you can write jsp code inside javascript function. Just include the code between the conventional <% and %>. Make sure it comes inside the javascript function you want to execute.

Any way some cons are there in this approch. You better try and see.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66260
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ajith George:
Ofcourse you can write jsp code inside javascript function.


This is misleading. You can put the JSP code inside the Javascript function, but it will not execute in-line with the javascript code.

Please see this article for an explanation of why.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!