Java code


String str = "{"officeName" : "name", "deviceName" : "device", "nickName" : "nick"}";


private native void test2(String str) /*-{

$wnd.test(str);

}-*/;




JavaScript code


function test(str) {

var obj = JSON.parse(str);

alert(obj.officeName);

alert(obj.deviceName)

alert(obj.nickName);

}




http://stackoverflow.com/questions/4935632/how-to-parse-json-in-javascript



Posted by LeeSh217
,