series: [{
type: 'pie',
name: '浏览器',
data: [
['Firefox', 45.0],
['IE', 26.8],
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
]
}]类似于这种 怎么把后来传过来的json弄进去呢
type: 'pie',
name: '浏览器',
data: [
['Firefox', 45.0],
['IE', 26.8],
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
]
}]类似于这种 怎么把后来传过来的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 jsonObject = JSONObject.fromObject( map );
System.out.println( jsonObject ); 2.前台ajax接收到响应转换为json:
var data = JSON.parse(req.responseText);
你浏览器调试一下data,看看就知道怎么用了。