获取JSON格式数据的key和alue

   
<script language="javascript">    function e()    {      var json=[{"kl_id":"2","kl_title":"test date","kl_content":"test date","kl_type":"1","id":"1"},{"kl_id":"2","kl_title":"test","kl_content":"test","kl_type":"1","id":"2"}]      var str = "";    for(var i = 0; i < json.length; i++)    {      var a = json[i]      for (var key in a)      {           str += key + ":" + a[key]+ ",";      }    }    alert(str);  }  e(); </script>
  

你可能感兴趣的:(java,工作)