<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <script type="text/javascript"> window.onload=function jsson(){ var text='{"a":"1", "b":"2", "c":"3"}'; //通过parse获取json对应键值 var jsonObject = JSON.parse(text, null); alert("The jsonObject value is " +jsonObject.a + ";" + jsonObject.b + ";" + jsonObject.c); //将字符串对象转换为JSON对象 alert(JSON.stringify(jsonObject)); //通过eval对去json对应键值 var B=eval('('+text+')') alert(B.a+";"+B.b+";"+b.c); var aa = eval('(' + text + ')'); //这里直接写 eval(text) 会报错的 alert(aa.a + ";" + aa.b + ";" + aa.c); } </script> </head> <body> </body> </html>