-
Oct 18th, 2012, 10:31 PM
#1
Thread Starter
Hyperactive Member
associative array in JS
hi all,
i have written an API in html5. and this is how i load it
HTML Code:
$(document).ready(function(){
oChart= new _chart("canvas4");
oChart.props.values= = [{ Name: "Rob", max:33, actual : 10, actual2: 15, color: "red" },
{ Name: "Carole", max: 28, actual : 9, actual2: 17,color: "greenyellow" },
{ Name: "David", max: 36, actual : 16, actual2: 8,color: "cyan" }
];;
oChart.refresh();
});
the dilema is, figures in the values array should be updated every second, and i can do that by calling ajax method that returns a tring in the format
[color][{ Name: "Rob", max:33, actual : 10, actual2: 15, color: "red" },
{ Name: "Carole", max: 28, actual : 9, actual2: 17,color: "greenyellow" },
{ Name: "David", max: 36, actual : 16, actual2: 8,color: "cyan" }
];[/color]
how to evaluate the returned string into the values array ??
thanks in advance ..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|