JSON基础知识小结
JSON基础知识总结一、?总结list.add( second )JSONArray jsonArray2 JSONArray.fromObject( list )2.
JSON基础知识总结
一、?总结
list.add( "second" );
JSONArray jsonArray2 = JSONArray.fromObject( list );
2.Map集合转换成json代码
Map map = new HashMap();
map.put("name", "json");
map.put("bool", Boolean.TRUE);
map.put("int", new Integer(1));
map.put("arr", new String[] { "a", "b" });
map.put("func", "function(i){ return this.arr[i]; }");
JSONObject json = JSONObject.fromObject(map);
",";??
?????????}???????}???????document.write(str);????
。。