Answers for "javascript get params from query string json object"

0

javascript get params from query string json object

let parameters = 'www.goole.com?code=1232';
// const value = parameters.get('emailVf');
var search = parameters.split('?')[1];
parameters = JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
alert(JSON.stringify(parameters))

output : {code:1232}:
Posted by: Guest on June-10-2021

Code answers related to "javascript get params from query string json object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language