I have used the WDDX tag extensively in the past to pass variables to
javascript but I always had a problem when passing structures that use
integers as their keys.

For example:

<cfset myStruct = StructNew()>
<cfset myStruct[3] = "test">
<cfset myStruct[8] = "hello">

<script>
        <cfwddx action="cfml2js" input="#myStruct#" toplevelvariable="mystruct">
</script>

This ends up erroring because when you look at the output, it shows:

<script>
        var mystruct = new Object();
        mystruct.3 = 'test';
        mystruct.8 = 'hello';
</script>

It would all work great if it used brackets instead of dot notation:

<script>
        var mystruct = new Object();
        mystruct['3'] = 'test';
        mystruct['8'] = 'hello';
</script>


My question is whether Macromedia realizes the bug and if it has been
corrected with CFMX.  Anybody know?




Ben Johnson

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to