javascript get params from query string json object

Solutions on MaxInterview for javascript get params from query string json object by the best coders in the world

showing results for - "javascript get params from query string json object"
Tommaso
10 Mar 2016
1let parameters = 'www.goole.com?code=1232';
2// const value = parameters.get('emailVf');
3var search = parameters.split('?')[1];
4parameters = JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
5alert(JSON.stringify(parameters))
6
7output : {code:1232}: