0
這適用於所有其他瀏覽器,但在Firefox中,我需要點擊我的「顯示更多評論」鏈接兩次,才能點擊我的點擊事件觸發。有任何想法嗎?jQuery在Firefox中需要切換兩次點擊
$moreReviewsWrapper.toggle(function() {
$(this).on('click', function(e) {
e.preventDefault();
var moreReviewEndpoint = $(this).data().more;
if(moreReviewEndpoint) {
$.ajax({
type: 'GET',
dataType: 'html',
contentType: 'text/html; charset=utf-8',
url: moreReviewEndpoint,
beforeSend: function() {
$moreReviewsLink.text('Loading more reviews ...');
},
success: success,
error: function(){
$moreReviewsLink.prop('hidden', false);
$moreReviewsLink.text(originalText);
$commonError.show();
}
});
}
});
}, function() { $(this).off(); });