How to convert a multidimensional array of JSON into a multi-dimensional array of JS
PHP Code
JScript Code
$.getjson (".. /php/json.php?parm=arr2 ", function (JSON) {//The middle should be how to write});
The final JS if it is
JScript Code
var arr1=["A", "B", "C"]; var arr2=[ ["A1", "A2", "A3"], ["B1", "B2", "B3"], ["C1", "C2", "C3"] ]; var arr3=[ [ ["A11", "A12", "A13"], ["A21", "A22", "A23"], ["A31", "A32", "A33"] ], [ ["B11", "B12", "B13"], ["B21", "B22", "B23"], ["B31", "B32", "B33"] ], [ ["C11", "C12", "C13"], ["C21", "C22", "C23" ], ["C31", "C32", "C33"] ] ;
------Solution--------------------
JS is not so familiar with, so I want to know is actually passed JSON to JS, but also to restore the group to do?
------Solution--------------------
JQuery's Getjson method has converted the received data into an array of JSON objects
Meaning JSON in function (JSON) is an array of JSON objects
You can already use the json.name directly.
Under normal circumstances, the end is exhausted.
Look at your description, it seems to be to construct a global variable from it
You can walk through each of these members with a for (k in JSON), and use the Eval function to import them into global variables.
Of course the variable name you have to construct yourself, because your PHP code is not outgoing