Hello, I am experiencing the following problem in my JSP page which uses javascript; I need to intialize a javascript variable as follows: rootFld = F("class").I("1.1").I("1.2")._(F("1.3").I("1.3.1").I("1.3.2"))._(F("1.4").I("1.4.1"))._(F("1.5").I("1.5.2")) ; This variable represents a dynamic tree structure that is to be displayed on the webpage. I need to initialize the above variable from a variable in java scriptlet. As you can see the variable is not a string and I am not sure how to initiaze it using a java variable. Any help is much appreciated thanks
Chris Reeves
Ranch Hand
Joined: Apr 03, 2002
Posts: 95
posted
0
In your jsp, set a String to the value you wish to assign to the javascript variable: String jsVar = "whatever"; Then, set the javascript variable in the output:
Ronald Francis
Ranch Hand
Joined: Aug 02, 2001
Posts: 30
posted
0
Watch out ...the double quotes in your example could cause some pain ..
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6913
posted
0
Please don't post teh same question in more than one forum. You obviously read more than one forum, so do the people who might answer your question. There are more answers to this question in this other thread, but I have closed it and referred readers to this one.