Generic way of doing this would be:
<cfoutput query="qry_getaddresses">
<cfset arrayIndex = qry_getAddresses.recordcount - 1 />
addresses[#arrayIndex#] = '#name#, #address#, #city#, #state#';
</cfoutput>
.... ya it clutters up your display page code, but it works. It also makes
debugging any javascript syntax issues (i.e. name = "o'connor" - the extra ') a
breeze :).
Jake Pilgrim
>I need to dynamically populate "addresses" as shown below:
>
><script type="text/javascript">
>var addresses = new Array("Redwood City, CA", "Palo Alto, CA", "Santa
>Clara, CA", "San Jose, CA", "Sunnyvale, CA", "Mountain View, CA",
>"Milpitas,CA");
></script>
>
>I've been trying to use listappend but keep running into the issue of
>the quotes as delimiters above.
>
><cfset addresses ="">
>
> <cfoutput query="qry_getaddresses">
>
><cfset addresses = listappend(addresses, "#name#, #address#, #city#,
>#state#")>
>
></cfoutput>
>
>Am I missing the boat entirely on this?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272068
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4