0
각각 클릭 한 후 값을 저장하는 방법 내가 가진 I 후에 실행이 기능은 내가 모든 클릭 후 두 번째 매개 변수 (수) 증가 할아약스
function Wo_GetMorePosts() {
var query = $(".search-for-posts").val()
if (search_status == "1"){
Wo_SearchForPosts(query,1)
}else{
$.get(Wo_Ajax_Requests_File(), {
f: 'posts',
s: 'load_more_posts',
filter_by_more: filter_by_more,
after_post_id: after_post_id,
user_id: user_id,
page_id: page_id,
group_id: group_id,
posts_count: posts_count
}, function (data) {
if (data.length == 0) {
$.get(Wo_Ajax_Requests_File(), {f: 'get_no_posts_name'}, function (data3) {
$('#load-more-posts').html('<div class="white-loading list-group"><div class="cs-loader"><div class="no-more-posts-to-show">' + data3.name + '</div></div>');
});
} else {
$('#posts').append(data);
}
});
}
$('#load-more-posts').show();
$('.loading-status').remove();
Wo_progressIconLoader($('#load-more-posts'));
scrolled = 0;
}
내 문제가 Wo_SearchForPosts(query,1)
에있는 버튼을 클릭합니다. 따라서 두 번째 클릭은 Wo_SearchForPosts(query,2)
이됩니다.
어떻게 만들 수 있습니까?
'var counter = 1;'변수를'Wo_GetMorePosts()'함수 위에 추가하십시오. 'Wo_SearchForPosts (query, 1);을'Wo_SearchForPosts (query, counter ++);로 대체하십시오. – Patrick2607