注意:工程中引入jquery-latest.js文件
<script type='text/javascript' src='js/jquery-latest.js'></script>
<script type="text/javascript">
var id='<%=request.getParameter("id")%>';
var murl='http://192.168.1.122:8080/bjmobile/getspdetail.do';
murl=murl+'?id='+id;
$(function() {
$.post(murl,function(data){
var json=eval("(" + data + ")");
//alert(data);
var det='<div class="pname"><font color="#FF99FF">'+json["detail"][0].prodname
+'</font></div>';
det=det+' <div class="pic1"><img class="size" src="'+json["detail"][0].mpicture+'"/></div>';
det=det+'<div>喜欢:'+json["detail"][0].loves+' '+'<a href="'+json["detail"][0].rrodurl+'"><font class="money">';
det=det+'¥'+json["detail"][0].prodprice+' 去看看</font></a></div>';
$("#bpicture").html(det);
//alert(json["detail"][0].sharePlList.length);
var coms='';
if((json["detail"][0].sharePlList.length)>0){
for(var i=0;i<(json["detail"][0].sharePlList.length
);i++){
coms=coms+'<div class="comments"><font class="sty">'+json["detail"][0].sharePlList[i].content;
coms=coms+' 来自:'+json["detail"][0].sharePlList[i].username
+' '+json["detail"][0].sharePlList[i].createtime+'</font></div>';
}
}
else{
coms=coms+'暂无评论';
}
$("#pl").html(coms);
});
});
</script>
?
html页面中的代码:
<body>
<div class="head1">
<div class="back1"><input type="submit" value="返 回" onclick="javascript:history.go(-1);"></div>
</div>
<div id="bpicture"
>
</div>
<div class="pp" id="pl"
>
</div>
</body>
?