js remove url get parameter

Solutions on MaxInterview for js remove url get parameter by the best coders in the world

showing results for - "js remove url get parameter"
Federica
15 Aug 2020
1function removeParams(sParam)
2{
3            var url = window.location.href.split('?')[0]+'?';
4            var sPageURL = decodeURIComponent(window.location.search.substring(1)),
5                sURLVariables = sPageURL.split('&'),
6                sParameterName,
7                i;
8         
9            for (i = 0; i < sURLVariables.length; i++) {
10                sParameterName = sURLVariables[i].split('=');
11                if (sParameterName[0] != sParam) {
12                    url = url + sParameterName[0] + '=' + sParameterName[1] + '&'
13                }
14            }
15            return url.substring(0,url.length-1);
16}
17
18window.location = removeParams(parameter);
queries leading to this page
how to remove param from url javascriptjavascript remove params from urlremove value from url javascriptremove url parameter from urljavascript remove specifc parameter form urlremove url param javascriptjs remove url get parameterremove specific url parameters javascriptremove url parameter javascriptget url remove parameters javascripthow to remove parameter from url in javascripthow to remove params from urlremover param in url jshow to remove url parameters javascriptjs remove parameters from urljs remove parameter from url without reloadremove params from url jsjs remove param from url in browserjs url delete paramsjs remove parameter from urlhow to remove params from url nodejsjavascript remove url parameterdelete url parameters javascriptremove url paramter jsremove params from urldelete parameter to current url javascriptremove params in url in javascriptremove param from url javascriptjs remove get parameters from urldelete speicif param value from url jsremove parameter in url javascriptjs remove parameter contain from urljavascript remove url parameter without reloadingremove parameter from url javascriptremove sapce from url parameterremove all url parameters in javascriptremove params from url javascriptremove get parameter from url javascriptremove parameters from a url javascriptjavascript remove get parameter from urljavascript remove parameter from urlremove param with value url jsdelete a param from current url jsremove url parameters javascriptjs remove param from urlremove url parameters in javascriptremove parameter from url javascript without reloadjs remove url get parameter