qs
qs copied to clipboard
Please add decodeURIComponent() to parse GET parameters correctly
In case we have array of GET parameters like ?filters[showDeleted]=1,filters[hideInactive]=1
gs.get() will return encoded params with replaced special symbols
params = {
"filters%5BshowDeleted%5D": 1,
"filters%5BhideInactive%5D": 1,
}
Problem appears than I am trying to reload page with new GET params, there %5B and %5D are encoded one more time to %255B and %255D accordingly.
var r=decodeURIComponent(window.location.search)
solves that:
params = {
"filters[showDeleted]": 1,
"filters[hideInactive]": 1,
}