How to change url after success in ajax without page reload

前端 未结 3 1087
孤城傲影
孤城傲影 2020-12-24 02:23

This is the ajax



        
3条回答
  •  遥遥无期
    2020-12-24 03:20

    try this

    $(".urut").change(function() {
    $.ajax({
        url: "categories/brand/?l=&h=&city=&city_name=&ket=view",
        type: "POST",
        data: "urut=" + $(".urut").val(),
        success: function(data) {
            $("#result").html(data);
            window.history.pushState("Details", "Title", "/yourNewPage");
        }
    });
    

    });

提交回复
热议问题