if (history.pushState) {

var newurl = window.location.protocol + "//" + window.location.host +                  window.location.pathname + '?queryParam1=paramValue1' ;
                                                        window.history.pushState({path:newurl},'',newurl);

}

Above snippet does the trick for you, It will change the url but not does the action.

Enclose with the javascript function copy paste the function in JS.

call the below function where ever required. ex:

                 pushQueryParam ( “param1=value1&param2=value2&param3=value3” );

function pushQueryParam ( queryParams ){

if (history.pushState) {

   var newurl = window.location.protocol + "//" + window.location.host +
             window.location.pathname + '?' + queryParams;
             
   window.history.pushState({path:newurl},'',newurl);

  }
}
Advertisements