In my website blog pages added query string in that page URL. I wanted to remove the query string from the URL. So i used to go with jquery and i wrote and added into my scripts. It removes the query string but keep on refreshing the page upto nth time. I used to "one" jquery method. That also doesn't work.
Can you help me
My Script is
jQuery(document).one('ready',function(){
window.location.href = window.location.href.split('?')[0];
});
window.location.hrefhas?first..indexOf()to check.window.location.hrefhas a?is that the result of split is an array of at least one string. Try for yourself:"https://example.com".split('?')[0]results inhttps://example.com, thus causing a redirect loop when you keep updating window.location.href to itself.