Pass variables from java to javascript -


i'm new javascript programming, , have question not find answer anywhere.

i have code in java stuff 2 double arrays

double[] arrx = new double[sizea]; double[] arry = new double[sizeb]; 

then, need pass these 2 variables html/javascript code need use them.

is possible?

would recommend following:

  1. install apached tomcat http://tomcat.apache.org/tomcat-6.0-doc/appdev/

  2. try hello world example included in apached tomcat http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/

you find values in variables shown in gui.

next step assigning java variables javascript variables, use following syntax

<script type="text/javascript"> var jsvariable =<%javavariable%>; </script> 

hoping helps.

cheers !!


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -