.Set not updating value

20 Views Asked by At

Im trying to change my url params value,I have attated my code below.

let Pageurl = new URLSearchParams(window.location.search);
let Queryparam = Pageurl.get('paramsType');
window.onload = function() {
if(document.getElementById(paramsType)){
shiftContent(Queryparam);
} else {
window.location.search = '?' + 'paramsType=params';
}
};

* function shiftContent(newParam) {
  Pageurl.set('paramsType', newParam);
  }\*


Here, the .set function now working, they didn't change the paramsType value.

I try to changes my Queryparams value.

0

There are 0 best solutions below