js javascript 相关操作

    js 处理json格式数据(json可以通过php的json_decode生成)
<script language="javascript"><br>    var str = '{"test":{"name":"\u8ba1\u7b97\u673a\u8f6f\u4ef6","list":{"1114101":"\u9ad8\u7ea7\u8f6f\u4ef6\u5de5\u7a0b\u5e08","1114102":"\u8f6f\u4ef6\u5de5\u7a0b\u5e08","1114103":"\u8f6f\u4ef6ui\u8bbe\u8ba1\u5e08\/\u5de5\u7a0b\u5e08","1114104":"\u4eff\u771f\u5e94\u7528\u5de5\u7a0b\u5e08","1114105":"erp\u5b9e\u65bd\u987e\u95ee","1114106":"erp\u6280\u672f\u5f00\u53d1","1114107":"\u9700\u6c42\u5de5\u7a0b\u5e08","1114108":"\u7cfb\u7edf\u96c6\u6210\u5de5\u7a0b\u5e08","1114109":"\u7cfb\u7edf\u5206\u6790\u5458","1114110":"\u7cfb\u7edf\u5de5\u7a0b\u5e08","1114111":"\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1\u5e08","1114112":"\u6570\u636e\u5e93\u5de5\u7a0b\u5e08\/\u7ba1\u7406\u5458","1114113":"\u8ba1\u7b97\u673a\u8f85\u52a9\u8bbe\u8ba1\u5de5\u7a0b\u5e08","1114100":"\u5176\u4ed6"}}}';
<br>    var json = eval('('+str+')');<br>    for(var key in json.test.list){<br>        alert(json.test.list[key]);<br>    }<br></script>
 

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