Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript urlsearchparams to object

var search = location.search.substring(1);
JSON.parse('{"' + decodeURI(search).replace(/"/g, '"').replace(/&/g, '","').replace(/=/g,'":"') + '"}')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #urlsearchparams #object
ADD COMMENT
Topic
Name
9+7 =