国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

js實現的點擊數量加一可操作數據庫

2024-05-06 16:05:32
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了js如何實現的點擊數量加一操作數據庫,需要的朋友可以參考下

復制代碼 代碼如下:


<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "http://www.survivalescaperooms.com/";
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"></script>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>寶寶排行榜</title>
<style type="text/css">
body {
text-align: center;
margin: 0 auto;
padding: 0;
background: #ffefe5;
width: 100%;
}

a:link {
text-decoration: none;
}

#static {
margin: 0 auto;
text-align: left;
}

img {
width: 100%;
}

#main {
background: url("../pic/bj_12.jpg") repeat-x;
padding-top: 5px;
}

#main span {
font-size: 1.5em;
color: #2f0075;
margin-left: 40px;
}

#bottom {
width: 100%;
margin: 0;
padding: 0;
font-size: 1em;
}

#bottom ul li {
width: 48%;
float: left;
margin-left: -8%;
margin-right:10%;
list-style-type: none;
}
.sp {
margin-top: -50px;
border-radius: 8px;
}
</style>
<script type="text/javascript">
$(function(){
//動態加載寶貝排行信息
function loadSecondSort() {
$.ajax({
type : "POST",
data : "groupId="+$("#groupId").val(),
url : "<%=basePath%>findBobyRankByVote.action",
success : 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><input type=/"hidden/" id=/"id/" value="+list[i].id+"><div class=/"sp/""+
"style=/"background-color: #ffb7cd; margin-top: 10px; height: 30px/">"+
"<img src=/"../pic/zan.png/" style=/"width: 22px; margin-left: 10px; margin-top: 5px;/" class=/"favour/">"+
"<span style=/"margin-top: 5px; color: #8a7da9; float: right; margin-right: 10px;/">已<span>"+list[i].vote+"</span>票"+
"</span></div></li>";
$(row).appendTo($("ul"));
}
}
}
});
}
$(".favour").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();
}
}else {
alert(data.msg);
}
});
});
window.onload = loadSecondSort();
});
</script>
</head>
<body>
<input type="hidden" value="<%=groupId%>">
<div>
<img src="../pic/top10.jpg"> <a href="../jsp/index.jsp"><img
src="../pic/fan.png"></a>
<div>
<span>近期排名:</span>
</div>
<div>
<ul>
</ul>
</div>
</div>
</body>
</html>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 广水市| 长白| 夏邑县| 日喀则市| 岐山县| 安国市| 吉隆县| 新昌县| 寻甸| 龙陵县| 巨野县| 盘锦市| 遵义市| 通化市| 岳池县| 迁西县| 淮安市| 湄潭县| 文昌市| 八宿县| 大埔区| 涞源县| 吉林省| 阳信县| 福安市| 保山市| 西平县| 东安县| 新龙县| 独山县| 商水县| 古交市| 溧水县| 三河市| 甘谷县| 富锦市| 盐源县| 蓬安县| 凤山市| 北川| 大姚县|