I created an array using vb.
Now I need to write a javascript func that uses this array.
Am I too much of an optimist?
Will java "see" and "understand" this array?
Server side; I have a small chunk of code on a separate page that I use as an #INCLUDE because multiple pages use it. I was able to access the array via VBScript on the page with the java function on it, so I know the array is there and readable(by vb anyway).
I could make this include as a javascript, but I don't know how. The elements of the array come from a database.
Go read the FAQ that Swany and I wrote on communicating between server & client side code, but the basic syntax would be this:
<%
'your array is already made and is called myArray
dim j
j = 1
%>
<script language=javascript>
function makeArray(){
var theArray[5];
var i
for (i = 1; i <= 5; i++){
theArray=<%
response.write(myArray(j))
j = j + 1%>;
}
}
</script>
so you see how they are operating independent of each other, but the server side code is writing the contents of its array to the screen while the javascript is assigning those values to the elements of its array.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.