日期:2014-05-16 浏览次数:20613 次
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../script/jquery.js"></script>
</head>
<body>
<div id="dd" ></div>
<a href='#' onclick='show();'>a</a>
<script type="text/javascript">
function show(){
alert("...");
$.ajax({
url: "http://localhost:8080/webroot/show_info.action",
type: "POST",
dataType:"json",
success: function(data) {
var music;
//i表示在data中的索引位置,n表示包含的信息的对象
$.each(data,function(i,n){
//获取对象中属性为optionsValue的值
music=n["content"];
});
$('#dd').append(music);
}
});
}
</script>
</body>
</html>
{"message":"ok","aboutUs":{"content":"123","id":1,"title":"关于我们"}}