• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scriptlet and Javascript  RSS feed

 
Amarnath Joshi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I've a simple logic Code to increment a variable from javascript and Send it back to jsp.

i just writing simple code to explain the logic. My code will have scritplets forgive me.

I know usage of scriptlets is inside jsp is oldest but for the sake of logic.



But My value of i is not incrementing its showing that function is undefined
 
Amarnath Joshi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please also Suggest if there is any other alternate in ajax to retrieve the values..
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a very fundamental misconception of how JSPs work. Read http://www.javaranch.com/journal/200510/secret-life.html before you write any more code. Then you'll understand why what you're trying to do doesn't wok (and why it can't be made to work).
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a JavaScript library like jQuery can use AJAX-like approaches to synchronize a JavaScript variable with a server-side variable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!