Hi,
I am using a global variable qArray in js file.I have include this file in a jsp file.
Now I am using a list<String> to populate the qArray.
On click of a button on the jsp page I want to access the qArray but i am not able to do so.
below is the code snippet:
please help me out
I am using a global variable qArray in js file.I have include this file in a jsp file.
Now I am using a list<String> to populate the qArray.
On click of a button on the jsp page I want to access the qArray but i am not able to do so.
below is the code snippet:
Code:
// in abc.js
qArray=new Array();
function removeProducts(){
alert(quoteProductsArray[0]);
}
// in abcd.jsp
<script>
<%
for(int i=0;i<qProducts.size();i++)
{
%>
qArray[<%=i%>]='<%=qProducts.get(i)%>'
<%
}
%>
</script>
<input align="right" type="button" value="Update Products" name="RemoveProducts" onclick="removeProducts()"/>
Comment