Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

query string to object javascript

var search = location.search.substring(1);
JSON.parse('{"' + search.replace(/&/g, '","').replace(/=/g,'":"') + '"}', function(key, value) { return key===""?value:decodeURIComponent(value) })
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #query #string #object #javascript
ADD COMMENT
Topic
Name
1+4 =