Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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}:
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #params #query #string #json #object
ADD COMMENT
Topic
Name
1+5 =