要求点击第一页是url+p1html,点击第二页是url+p2html等等

 $("body").on('click','#w_tagPage a[wid]',function(){
                $(this).addClass("w-active").siblings("#w_tagPage a[wid]").removeClass("w-active");
                var kindVal=$(".w-tagNav:not(.w-disno) a.w-active").attr("id");
                var pageVal=$(this).attr("wid");
                //console.log(kindVal+'--'+pageVal);
                $.ajax({
                    url: "/index.php?tags-getitems.html",
                    type: "POST",
                    data: {
                        cat_id: kindVal,page_id: pageVal
                    },
                    success: function (html) {
                        var stateObject = {};//翻页同时更改链接
                        var title = "";
                        var newUrl = '/p'+pageVal+'html';
                        history.pushState(stateObject,title,newUrl);
                        $("#w_tagContent").html(html);
                    }
                })
            })

 

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2021-08-20
  • 2022-12-23
  • 2022-01-17
  • 2021-11-26
  • 2021-05-01
  • 2022-01-14
猜你喜欢
  • 2021-10-14
  • 2021-05-26
  • 2021-12-06
  • 2021-12-17
  • 2022-12-23
  • 2022-01-07
  • 2021-05-28
相关资源
相似解决方案