Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy putting asp/php values into javascript array

    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 !
    - az

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure, loop through the data, and write it dynamically into the javascript that will be sent to the client.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation like this ?

    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 !
    - az

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •