我正在試圖在當前div項的子元素中添加ajax加載的內容,但它不起作用,無法找出問題出在哪裏。
如何在當前子元素中加載ajax響應?
這裏是HTML代碼:
<div class="thumb-pitch">
<span class="pitch-count" ></span>
</div>
<div class="thumb-pitch">
<span class="ditch-count"></span>
</div>
JS代碼:
$('.thumb-pitch').click(function() {
var id= $(this).attr('cid');
var dataString = 'idea_id='+ id;
$.ajax({
type: 'POST',
url:"<?php echo base_url();?>users/user_votes/user_pitch",
data:dataString,
success: function(response) {
//alert(response);
$(this).find('span').html(response);
}
});
});
阿賈克斯響應是否好? – divakar 2014-10-07 05:33:10
有沒有一個'/'在用戶在URL和$(這個)不會是你認爲 – loveNoHate 2014-10-07 05:33:59
請分享**響應**對象的細節? – Mayank 2014-10-07 05:40:24