通过for in:
var json = {width: '200px', height: '200px', background: 'green'}; var i = ''; for(i in json){ console.log(i+':'+json[i]); }