Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
264 views
in Technique[技术] by (71.8m points)

php - Want to pass ID variable to existing Ajax page

I'm having difficulty sending the variable to this Ajax page, the keywords and sortBy variables are passing correctly. Any ideas ?

<script>
function searchFilter(page_num) {
page_num = page_num?page_num:0;
var keywords = $('#keywords').val();
var sortBy = $('#sortBy').val();
    var id = $('#id').val();
$.ajax({
    type: 'POST',
    url: 'https://techhum.com/jquery-ajax-pagination-with-search-master/getData.php',
    data:'page='+page_num+'&keywords='+keywords+'&sortBy='+sortBy+'&id='+id,
    beforeSend: function () {
        $('.loading-overlay').show();
    },
    success: function (html) {
        $('#posts_content').html(html);
        $('.loading-overlay').fadeOut("slow");
    }
 });
 }
</script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...