function vote(d,obj){ //tpl,do,showok,callback,id,tb,col d.tpl="vote"; if(cookies.get(d.tbl+d.id)!=undefined)return; cookies.set(d.tbl+d.id,d.id,{ expires: 43200 }); $.post("/srv/vote.php",d, function (data, e) { if(d.showok!=undefined&&d.showok!="")alert(d.showok); if(obj!=undefined){ v=$(obj).text().replace(/[^0-9]/ig, ""); if(v=="")v="1";else v= parseint(v)+1; $(obj).text(v); } if(d.callback!=undefined&&d.callback!="")window[d.callback](data); }); } //获取地址栏参数 function querystr(name) { var allvars = window.location.search.substring(1);//即location.href中?后面的内容 var vars = allvars.split("&");//分割条件 for (i = 0; i < vars.length; i++) { var var = vars[i].split("="); if (var[0] == name)return var[1];//返回地址栏中相应参数的值 } return ""; }