Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how can i use javascript variable in jsp  RSS feed

 
arulraj michaelraj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want search in hashtable which is in jsp
but i have to implement this process using javascript variable
like this

fuction hello(funtionid)
{
namelist.get(functionid)
}
here
functionid is javascript variable
namelist is hashtable which is in jsp.


please tell me suggestion
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is impossible, you can't access JSP (server side) with Javascript (client side)
 
Frederic Filiatrault
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And to complete, only way would that you dynamically write the declaration of an array in the output as JavaScript code and then, would be able to use it.

Painful but that`s life !
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!