复制代码代码如下:
<%@ページ言語= "java" contentType = "text/html; charset = utf-8"
PageEncoding = "UTF-8"%>
<%
string path = request.getContextPath();
string basepath = request.getscheme() + "://"
+ request.getServername() + ":" + request.getServerport()
+ path + "/";
string groupId = request.getParameter( "GroupId");
%>
<!doctype html public " - // w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = utf-8">
<script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"> </scrip>
<Meta content = "width = device-width、initial-scale = 1.0、maximing-scale = 1.0、user-scalable = no" name = "Viewport">
<title>宝宝排行榜</title>
<style type = "text/css">
体 {
テキストアライグ:センター;
マージン:0 Auto;
パディング:0;
背景:#ffefe5;
幅:100%;
}
A:link {
テキスト装置:なし;
}
#static {
マージン:0 Auto;
テキストアライグ:左;
}
img {
幅:100%;
}
#主要 {
背景:url( "../ pic/bj_12.jpg")Repeat-x;
パディングトップ:5px;
}
#mainスパン{
Font-Size:1.5EM;
色:#2F0075;
マージン左:40px;
}
#底 {
幅:100%;
マージン:0;
パディング:0;
font-size:1em;
}
#bottom ul li {
幅:48%;
フロート:左;
マージン左:-8%;
マージン右:10%;
リストスタイルタイプ:なし;
}
.sp {
マージントップ:-50px;
ボーダーラジウス:8px;
}
</style>
<script type = "text/javascript">
$(function(){
//动态加载宝贝排行信息
function loadsecondsort(){
$ .ajax({
タイプ:「投稿」、
データ: "GroupId ="+$( "#groupid")。val()、
url: "<%= basepath%> findbobyrankbyvote.action"、
成功:function(data){
var list = data.list;
var row = "";
$( "ul")。empty();
if(list!= null && list.length!= 0){
for(var i = 0; i <list.length; i ++){
row = "<li> <a href =/" bao_x.jsp?id = "+list [i] .id+"/"> <img src =/" ../ pic/"+list [i] .pic+"/"> </a> <入力タイプ=/" hidden/"id =/" id/"+"+"
"style =/" background-color:#ffb7cd;マージントップ:10px;高さ:30px/">"+
"<img src =/" ../ pic/zan.png/"style =/" width:22px;マージン左:10px;マージントップ:5px;/"class =/" fave/">"+
"<span style =/"マージントップ:5px;色:#8a7da9;フロート:そうです;マージン右:10px;/">已<span>"+list [i] .vote+"</span>票"+
"</span> </div> </li>";
$(row).appendto($( "ul"));
}
}
}
});
}
$( "。fave")。live( "click"、function(){
var id = $(this).closest( "li")。find( "#id")。val();
$ .post( "<%= basepath%> updatebobyrank.action"、 "id =" + id、
function(data){
if(data.msg == null){
if(data.success == true){
loadsecondsort();
}
}それ以外 {
アラート(data.msg);
}
});
});
window.onload = loadsecondsort();
});
</script>
</head>
<body>
<input type = "hidden" id = "groupId" value = "<%= groupId%>">
<div id = "static">
<img src = "../ pic/top10.jpg"> <a href = "../ jsp/index.jsp"> <img
src = "../ pic/fan.png"> </a>
<div id = "main">
<span>近期排名:</span>
</div>
<div id = "bottom">
<ul>
</ul>
</div>
</div>
</body>
</html>