passing variables to js file

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default passing variables to js file

    I don't know if this is possible but let's see.

    I have a page that generates a javascript array (of pictures) from a database.

    ..
    ..
    ..
    <head>
    <script type="text/javascript">
    var myArray = new Array();
    <cfloop index="i" from="0" to="#Evaluate(ArrayLen(picArray)-1)#" step="1">
    myArray[<cfoutput>#i#</cfoutput>] = "<cfoutput>#picArray[i+1]#</cfoutput>";
    </cfloop>
    </script>
    </head>

    <body>
    <script src="test.js" type="text/javascript"></script>
    </body>


    Now is there a way to use myArray inside test.js?

    I was sure I have done it before but for some reason it's not, I might be wrong...

    Thanks



    dandev webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Passing Variables
      Hi there, I just managed to install apache2 webserver with php 4.3.8. I'm developing some php files. Previously I used an external webserver but...
    2. passing variables from a php file into an array
      hey guys, i have successfully created a php file that reads and echoes the contents of a directory in the string var1=value2&var2-value2... ...
    3. Passing ASP Variables
      I have a form that submits to a SQL database. The table in SQL uses an identity field for the primary key called "entry". This is so I can get the...
    4. variables, passing again to another.
      if ($psi_shipping_addtnl_info != '') { echo '<< NO USER INPUT >>'; } Im catching a _POST variable from a form, now i wonder im filtering it out...
    5. Variables not passing from html file to php file
      I have the following two files used to insert data into a database. when meinsert.php is executed a blank record is inserted in the database as if...
  3. #2

    Default Re: passing variables to js file

    forget it it works now ???

    Thanks


    dandev webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139