Answers for "javascript how to get query param"

2

javascript reading query parameter

// example url: https://mydomain.com/?fname=johnny&lname=depp
const urlParams = new URLSearchParams(window.location.search);
const firstName = urlParams.get('fname'); // johnny
Posted by: Guest on September-18-2020
0

get query params from url javascript

const queryString = window.location.href;
const parameters = new URLSearchParams(queryString);
const value = parameters.get('key');
Posted by: Guest on August-20-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language