hai all,
can any one please tell me how pass an integer array to a javascript function. I have one jsp page. In that page i have written one javascript function "display(intArray)". I am passing integer array to this function from jsp page. But if i display the values of the array it is showing "NaN".
my javascript function is
I am passing the integer array to display(opion) is::
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12267
1
posted
0
My advice is to write a static HTML page with exactly the kind of Javascript you want, including the array of integers the way Javascript wants to see it.
With that as a working example, figure out how you can get JSP to write it.
Eduardo Bueno wrote:Try passing the array via String.
Again, that is not "passing the array" -- which you cannot do.
That's using JSP to create JavaScript markup just as William and I have advised.
Andy Crane
Greenhorn
Joined: Dec 30, 2008
Posts: 17
posted
0
As a suggestion, there may already be an object out there that will take an array in java and output a JSON formatted string that you can use.
- andy c
"Pseudo code first. If you can pseudo code accurately, when you start writing code, you're just applying syntax to the pseudo code. It separates the two most complicated pieces of programming into manageable bites. You create your app's workflow without worrying about syntax. Then you code without worrying about your app's workflow."