Hi all, I have a jsp and a js files. I would like to pass arrays from the jsp to a function in the js file via the onload attribute in the body tag. How can I do that?
For example:
<head>
<script language="javascript" type="text/javascript">
var indexNames = ['chIndex', 'recordIndex'];
var indexLocation = [0, 1];
</script>
</head>
<body onload="addRowHandlers('row', 2, $indexNames, $indexLocation)">
The output is not correct and I think $indexNames and $indexLocation are not the right way to pass the arrays.
Of course, in this case, I can separate the array values into multiple parameters. I am just want to make the javascript function more general. Thanks in advance.
Kenneth