php++点击数量加一,js实现点击数量添加入数据库

pageEncoding="utf-8"%>

String path = request.getContextPath();

String basePath = request.getScheme() + "://"

+ request.getServerName() + ":" + request.getServerPort()

+ path + "/";

String groupId = request.getParameter("groupId");

%>

宝宝排行榜

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;

}

$(function(){

//动态加载宝贝排行信息

function loadSecondSort() {

$.ajax({

type : "POST",

data : "groupId="+$("#groupId").val(),

url : "findBobyRankByVote.action",

success : function(data) {

var list = data.list;

var row = "";

$("ul").empty();

if (list != null && list.length != 0) {

for(var i=0;i

row = "

%22+list%5Bi%5D.pic+%22%5C%22

"style=\"background-color: #ffb7cd; margin-top: 10px; height: 30px\">"+

"zan.png%5C%22"+

"已"+list[i].vote+"票"+

"

";

$(row).appendTo($("ul"));

}

} www.jquerycn.cn

}

});

}

$(".favour").live("click",function(){

var id = $(this).closest("li").find("#id").val();

$.post("updateBobyRank.action", "id=" + id,

function(data) {

if (data.msg==null){

if (data.success == true) {

loadSecondSort();

}

}else {

alert(data.msg);

}

});

});

window.onload = loadSecondSort();

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值