...

View Full Version : putting asp/php values into javascript array



d2kagw
01-15-2003, 01:09 AM
Hi Everyone,

I was just wondering if there was any way of filling a javascript array with values from php or asp values?

say I have an asp array and I want to place its values into a javascript array, is there anyway to transfer the data to be used within a page?

Many Thanks ! :confused:

whammy
01-15-2003, 01:15 AM
Sure, loop through the data, and write it dynamically into the javascript that will be sent to the client. :confused:

d2kagw
01-15-2003, 01:31 AM
is it somthing like this?

<% while (blah blah)
x = x + 1%>
<script>
x++
myarray[x]=<%myotherarray[x]%>
</script>
<%wend%>

im really spure new to javascript, so im basically guessing.

Thanks v much ! :thumbsup:

whammy
01-15-2003, 01:35 AM
I guess the syntax depends on which server-side language you are intending to use... that is correct for neither as far as I know, but you have the right idea.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum