<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>无标题 1</title>
</head>
<body>
<script type="text/javascript">
//假设你生成的字符串保存在listString里面
//JSP里面的代码是这么写的
//var json = '<%=listString%>';
//生成HTML后如下
var json = '({book1:{author:"aaa",price:"23.5"},book2:{author:"bbb",price:"58"}})';
//js
var obj = eval(json);
for(var key in obj)
alert(key+"的作者是:"+obj[key].author+",价格是:"+obj[key].price);
</script>
</body>
</html>