3 Replies Latest reply on May 18, 2010 5:40 PM by Simon.Dau

    cfquery to javascript array to .js file

    Simon.Dau Level 1

      Hi guys,

       

      I've got a small problem out there:

       

      have cities table in the database therefore pulling out everything using cfquery .

       

      <cfquery name="get_city" datasource="IGES">
      SELECT *
      FROM cities
      ORDER BY City ASC
      </cfquery>

       

      Now all these city names from database needs to be passed to .js file in some sort of array

       

      <script type="text/javascript" src="../jscripts/add_school.js"></script>

       

      ^^^^^^^^that's the file all the javascript is in

       

      Is there any way to pass an array made from cfquery to javascript file where it can be used to populate listbox.

       

       

      cheers,

      Simon