Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get url query string value in javascript

const params = new Proxy(new URLSearchParams(window.location.search), {
  get: (searchParams, prop) => searchParams.get(prop),
});
// Get the value of "some_key" in eg "https://example.com/?some_key=some_value"
let value = params.some_key; // "some_value"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #url #query #string #javascript
ADD COMMENT
Topic
Name
6+7 =