鏈接在頁腳中,問題是:onclick,頁面跳轉到地址欄中的#標題,有沒有辦法留在頁腳?jQuery:POST數據無刷新
這裏是我的代碼
<a href="#" class="clickIn" id="1" attrIn="Like"><span style="color: #33A13D"><i class="fa fa-hand-o-up"></i></span></a>
$(document).on('click', '.clickIn', function(){
var $this = $(this);
var liCount = $('#liCount');
if($(this).attr('attrIn')=='Like'){
$.post('page.php',{i:$(this).attr('id'),action:'like'},function(){
$this.html('done');
$this.attr('attrIn','');
});
}
});
感謝