だから、私はそのような問題を抱えています.1回目は、<a>
クリックされたことe.preventDefault()
が機能せず、ページの上部にジャンプしますが、2回目は機能します。何が問題ですか?
$('#more a').live('click', function(e) {
var last = $('p.post').last().data('id');
console.log('start');
if (last != '1') {
$.ajax({
type: "POST",
url: "http://live.iappleworld.ru/ajax_more_mobile.php",
data: "last=" + last,
beforeSend: function() {
$('#more a').text('').prepend('<img src="http://live.iappleworld.ru/ajax-loader.gif" alt="loading"/> Loading...');
},
success: function(html) {
$("#more").remove();
$(html).hide().appendTo('ul.pageitem').slideDown(600);
}
});
}
e.preventDefault();
});
前後に別のスクリプトがあります。