I have a function in js which parse a url and creates a map of (paramName,value)
The code is like:
var search = location.search.substring(1);
var data = {}
if(search!="")
{
var urlParams = JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}');
for (var key in urlParams) {
data[key] = urlParams[key];
}
}
Now this is working fine for a plain url like www.google.com?param1=2¶m4=hello
But it is not working for a encrypted url like www.google.com?param1=XDTY-300Hbc=¶m4=hello
as here the param1=XDTY-300Hbc= contains a = in the end. Please help