hi everybody

i need for mi hobbie web app a transference between a java array and a javascript array. this is what i have tried to accomplish but it doesnt seem to work well:

<script type="text/javascript">
var arrayJS=new array();
<% String[] javaArray=(String[])request.getAttribute("names");%>
arrayJS=<%=javaArray%>;
for(var i=0;i<arrayJS.length;i++)
//data processing

any help would be so much appreciated

Member Avatar for stbuchok

Java and JavaScript are in no way related (except by name and name only). You will need to use a web service more than likely.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.