div class="info">
a target="_blank" title="展會現(xiàn)場人頭攢動">h4 class="title ellipsis download">展會現(xiàn)場人頭攢動/h4>/a>
p class="date">2017-02-01/p>
div class="sum">
span class="laud">i class="iconfont zanbtn" >贊/i>a href="javascript:;" rel="external nofollow" span style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: rgb(34, 34, 34); unicode-bidi: -webkit-isolate; font-family: Consolas, "Lucida Console", monospace; white-space: pre-wrap;">id/span>span style="color: rgb(34, 34, 34); font-family: Consolas, "Lucida Console", monospace; white-space: pre-wrap;">="/span>span style="min-width: 0px; min-height: 0px; box-sizing: border-box; color: rgb(34, 34, 34); unicode-bidi: -webkit-isolate; font-family: Consolas, "Lucida Console", monospace; white-space: pre-wrap;">zans{$r[id]}/span>span style="color: rgb(34, 34, 34); font-family: Consolas, "Lucida Console", monospace; white-space: pre-wrap;">" /span> title="span style="color: rgb(34, 34, 34); font-family: Consolas, "Lucida Console", monospace; white-space: pre-wrap;">$r[id]}/span>">0/a>/span>
/div>
/div>
$(".zanbtn").on("click",function(){
var id = $(this).next().attr("title");
var aval = $(this).next("a").html();
$.getJSON('http://phpcms.com/index.php?m=moodc=indexa=postid=150-'+id+'-1k=8'+Math.random()+'callback=?', function(data){
if(data.status==1) {
console.log( $(this).next());
$("#zans"+id).html(data.data);
}else {
alert(data.data);
return false;
}
})
});
以上所述是小編給大家介紹的Ajax實現(xiàn)phpcms 點贊功能實例代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!