If you are sure the imagepath doesn't contain any characters that have
to be escaped in JS (like '," or \) you could do

<cfquery name="getimglist" datasource="foo">
SELECT 'images/'+''+signimage as img
FROM signs
WHERE signtype =1;
</cfquery>

....


<Script>
var slideurl=new Array(#QuotedValueList(getimglist.img)#)
</script>

Otherwise:

<script type="text/_javascript_">
var slideurl = new
Array(#ListQualify(JSStringFormat(ValueList(getimglist.img)),"'"))#);
</script>

And if your values can contain commas:

<script type="text/_javascript_">
var slideurl = new
Array(#Replace(ListQualify(JSStringFormat(ValueList(getimglist.img,chr(7
))),"'",chr(7)),chr(7),",","all")#);
</script>
> -----Original Message-----
> From: Eric Creese [mailto:[EMAIL PROTECTED]
> Sent: donderdag 10 juni 2004 16:04
> To: CF-Talk
> Subject: Dynamic list generation
>
> Ok I want to query my database and get a comma list of images
> and then out put them into an array dynamically.  I have this
> non dynamic list now
>
> <Script>
> var slideurl=new Array("images/1.gif","images/2.gif","images/3.gif")
> </script>
>
>
> I want to replace the script above with the dynamic output
> list using a query like this
>
> <cfquery name="getimglist" datasource="foo">
> SELECT 'images/'+''+signimage
> FROM signs
> WHERE signtype =1;
> </cfquery>
> .
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to