This is an odd problem, i have an object (demQuestions), here is a dump of it (cut to 2 for simplicity):
[CODE]
Object {
0: Object {
question_short: “Number of beds”
op1: “Less than 50”
op2: “50 to 99”
op3: “100 to 299”
op4: “300 to 499”
op5: “500 or more”
}
1: Object {
question_short: “Type of service”
op1: “General medical and surgical”
op2: “Specialty: psychiatric”
op3: “Specialty: rehabilitation”
op4: “Specialty: pediatric”
op5: “Specialty: oncology”
op6: “Other (please specify)”
}
}
i need to get the “0” -> “question_short” value, but cant figure out how?
demQuestions.0.question_short = error (missing ; before statement)
eval (‘demQuestions.0.question_short’) = error (missing ; before statement)
i have been using this object alot but normaly i get the values using $.each(), so it cycles through 0,1,2,3,4… itself. how can i access the values directly without going through the $.each
seems like such a stupid problem but im far from an expert when it comes to JS object’s, im 99% sure the problem is the fully numeric “key” being used.
Thanks,
-aPeg