Is there any way to change the URl without refreshing the page?

is there any way to change the URl without refreshing the page and bring it to the browser of the next open link (or on URl or on any window attribute) during sharing

Mar.02,2021

window.history.pushState ()
look at this


here is the pjax I encapsulated in the project (listen, )

pjax file

module.exports = function(option){
    if( window.history.pushState ){
        //option.event.preventDefault() //A
        //JSON
        $.getJSON(option.getUrl, function(data){
            window.history.pushState({},0, option.winUrl);
            option.pinHtml(data);
            
        });
    };
}

call method:

$.PJAX({
     getUrl : "",  //JSONURL
     winUrl : $('-sharpurl').attr("href"),  //URL
     event  : event,
     pinHtml: function (data) {
         var html = '<li><i>'+data.detail.albums[0].itemId+'</i></li>';
         $(".box").html(html);
     }
 });
 

projects are accessed normally on google, but errors are often reported on the bottom version of Firefox, so there will be no problem with the upgrade. But recently, I want to delete the pjax in this project. The reason is that conditional filtering and data sorting are used in the project, so there is a great loss of traffic. Now change it back to a link jump

.
Menu