Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS get url params

const params = new URLSearchParams(window.location.search);
const something = decodeURIComponent(params.get('hi'));
// or shorter, no need to use variables
decodeURIComponent((new URLSearchParams(window.location.search)).get('hi'))
Source by github.com #
 
PREVIOUS NEXT
Tagged: #JS #url #params
ADD COMMENT
Topic
Name
6+6 =