Javascript中的json操作
<!doctype html> <html> <head> <title>extjs-json</title> <script type="text/javascript"> window.onload = function loadPage(){ var obj={ 1:"first", "2":"second" }; console.log(obj[1]);//打印 obj.sex ="man";//添加 delete obj.sex;//删除 for(var c in obj){//遍历 console.log(c+":",obj[c]); } } </script> </head> <body> </body> </html>