• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in assigning java value to javascript variable

 
Shobhit Khandelwal
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Here is me javascript function set() which takes values into list. i want to iterate through this list and want to pass values in another function addOption(). Below is my code, please try to find out where it is going wrong. Thanks in advance.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem here is there is serverside code in there and we have no clue what in the world it is outputting. View the generated page source.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65533
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on HTML and JavaScript, not JSP. For more information, please read this.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65533
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The days when it is acceptable to put scriptlets in JSPs is long past. You should be using the JSTL and EL at this point.

As Eric said, use View SOurce to see what's being generated.

And, you are needlessly creating an extra, unused instance of ArrayList. Sloppy.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll also need to make sure the items in the list are JavaScript-escaped.

I think.

It's really difficult to read that code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!