javascript help: i have a php page that echos
['A', 28.006660938911], ['B', 71.993339061089]
now i need this converted into an array in javascript, but in ajax, "var myData = new Array($http.responseText);" does not work
If given string is:
|
|||
|
json_encode
be used here? (Make sure to use the correct flags! :-) Also, this has been asked on SO like a bazillion times... on the JavaScript side use the appropriate JSON decoding, of course. There is no suchArray
constructor that takes a string. It just doesn't work like that. – user166390 Oct 25 '11 at 5:37