-
-
Save akinozgen/5ddd12c969f8df86be5dcccd481af6c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _g() { | |
vars = {}; | |
(window.location.href.split('?').length>1?window.location.href.split('?')[1]:'').split('&').forEach(_ => { | |
p=_.split('='); | |
vars[`${p[0]}`]=p[1].split(',').length>1?p[1].split(','):p[1]; | |
}); | |
return vars; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unset(a,b) { | |
g = _g(); | |
g[b] = (Array.isArray(g)?g:[g])[b].map(_=>{return decodeURIComponent(_);}).filter(x=>x!=a); | |
u = Object.keys(g).map(_=>`${_}=${Array.isArray(g[_]?g[_].join(','):g[_])}`).join(','); | |
window.location = `${window.location.href.split('?')[0]}?${uri}`; | |
} // unset('İmex', 'marka') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unset(a){ | |
var getVars = _get(); | |
getVars['marka'] = getVars.marka.map(_=>{return decodeURIComponent(_)}).filter(marka => marka != a); | |
var uri = Object.keys(getVars).map((_) => `${_}=${Array.isArray(getVars[_]) ? getVars[_].join(','):getVars[_]}`).join('&'); | |
window.location = `${window.location.href.split('?')[0]}?${uri}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment