Reputation: 509
I'm new to JavaScript programming, and I have a question that I could not find an answer to anywhere.
I have some code in Java that does some stuff with two double arrays
double[] arrX = new double[sizeA];
double[] arrY = new double[sizeB];
Then, I need to pass these two variables to a html/JavaScript code that need to use them.
Is that possible?
Upvotes: 2
Views: 6158
Reputation: 3709
Would recommend following:
Install apached tomcat http://tomcat.apache.org/tomcat-6.0-doc/appdev/
Try Hello World example included in Apached Tomcat http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/
You would find values in variables shown in GUI.
Next Step assigning java variables to javascript variables, use following syntax
<script type="text/javascript">
var jsVariable =<%javaVariable%>;
</script>
Hoping this helps.
Cheers !!
Upvotes: 1