<input type= "hidden" name= "Data" id= "Data" value= ' [{"name": "Beijing", "value": 1, "children": [{"Name": "Beijing 1", "Value": 12 , "Children": [{"Name": "Chaoyang 1", "value": +, "children": []},{"name": "Chaoyang 2", "value": +, "children": []},{"name": "Chaoyang 3", "Value": "Children": []},{"name": "Chaoyang 4", "value": +, "children": []}]},{"name": "Beijing 2", "value": +, "children": []}, {"Name": "Beijing 3", "Value": "Children": []},{"name": "Beijing 4", "value": +, "children": []}]},{"name": "Tianjin", "Value": 2, " Children ": [{" Name ":" Tianjin 1 "," value ": Wuyi," Children ": []}]}] '/>
[{},{}] correct
[{},{},] go to JSON object is error (direct write array not error)
varJsondata = $ ("#data") [0].defaultvalue;
varJsonobj =Json.parse (Jsondata); Layui.formSelects.data (' select15 ', ' local ', {arr:jsonobj, linkage:true ////Open linkage mode } );
JS convert JSON string to JSON object