Looks to me like it's just not the right syntax:
var holidayPackages = new Array("Explorer 60", "GetAway Plus", "Discovery",
"GetAway 300");
that will give you a 1d array... if you want a 2d array, you have to
manually insert the sub-array ...
var holidayPackages = new Array();
var Explorer60 = new Array("...","...");
holidayPackages[1] = Explorer60;
I'll bet you don't actually want an array here tho -- I'll bet you want a
structure, which is done in JS with new Object();
var holidayPackages = new Object();
holidayPackages["Explorer 60"] = new Object();
holidayPackages["Explorer 60"].dates = new Array("blah","...");
I'll bet there's an easier solution, however, using either wddx
<script language="javascript">
function whatever() {
var holidayPackages = null;
<cfwddx action="cfml2js" input="#mystruct#"
toplevelvariable="holidayPackages">
... etc...
}
</script>
Or in failing that, check out the open-source API I published recently at
http://www.turnkey.to/tapi -- look for the function cf_dom/js.object -- it
does what cfwddx action="cfml2js" does but it does it better in several
ways.
hth
s. isaac dealey 954-776-0046
new epoch http://www.turnkey.to
lead architect, tapestry cms http://products.turnkey.to
tapestry api is opensource http://www.turnkey.to/tapi
certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
> I tried posting this to js-jive (yahoo) and didn't get a
> response, so I
> guess I'll try here, since there's a lot of smart
> Javascripters on this
> list.
> I need to create some multidimensional arrays, but things
> aren't
> working like I expect ... this isn't working
> var holidayPackages = new Array();
> holidayPackages = ["Explorer 60", "GetAway
> Plus", "Discovery", "GetAway 300"];
> holidayPackages.["Explorer 60"].dates =
> ["Winter", "Easter", "Spring", "Value", "Summer", "Fall",
> "Halloween",
> "Fall 2", "Thanksgiving", "Holiday", "New Years"];
> I can get holidayPackages.dates to display the dates, but
> of course
> that does me no good. Each package has its own unique set
> of dates.
> And then, each of those date elements are going to need
> their own
> arrays of info (prices, four each for each date) ... and
> ideally,
> each date element/label will have the actual calendar date
> assigned,
> based on with package ... so in other words, I'm trying to
> build a
> pretty complex array of arrays tree.
> But I can't get over this first hump. What am I missing?
> H.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> Archives:
> http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
> Subscription: http://www.houseoffusion.com/cf_lists/index.
> cfm?method=subscribe&forumid=4
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Signup for the Fusion Authority news alert and keep up
> with the latest news in ColdFusion and related topics.
> http://www.fusionauthority.com/signup.cfm
> Unsubscribe: http://www.houseoffusion.com/cf_lists/uns
> ubscribe.cfm?user=633.558.4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
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
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4