Old 24-05-2006, 13:26   #1 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: Liverpool, UK
Posts: 1,963
javascript array problems

i have the array
Code:
SPECIAL_DAYS = { };

i want to put the value of "results" into SPECIAL_DAYS, results contains the following:

Code:
"2006-5" : [ 5 ], "2006-6" : [ 3 ], "2006-7" : [ 7 ], "2006-8" : [ 4 ], "2006-9" : [ 2 ], "2006-10" : [ 6 ], "2006-11" : [ 4 ], "2007-0" : [ 1 ], "2007-1" : [ 5 ], "2007-2" : [ 5 ], "2007-3" : [ 2 ], "2007-4" : [ 7 ], "2007-5" : [ 4 ], "2007-6" : [ 2 ], "2007-7" : [ 6 ], "2007-8" : [ 3 ], "2007-9" : [ 1 ], "2007-10" : [ 5 ]

i'm stumped, any suggestions?
  Reply With Quote
Old 24-05-2006, 13:31   #2 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: Liverpool, UK
Posts: 1,963
should probably point out that results is a variable from the result of an AJAX call
  Reply With Quote
Old 25-05-2006, 11:33   #3 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
is results a string or an array?
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Old 25-05-2006, 12:29   #4 (permalink)
stealthcow
knocking heads
 
stealthcow's Avatar
 
Join Date: Jul 2003
Location: Liverpool, UK
Posts: 1,963
its ok, i found the solution...

Code:
eval("SPECIAL_DAYS = { " + results + " };");
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8