get query param javascript
const queryString = window.location.search;
const parameters = new URLSearchParams(queryString);
const value = parameters.get('key');function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
};const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('myParam');
Also in JavaScript:
- less than or equal js
- javascript input onchange get value
- js dom ready function
- vanilla javascript jwt authentication laravel
- switch case in js
- unordered list in react native
- how to create a component in react native
- vue js cdn
- jest simulate toggle switch react native
- how to add js in flask
- javascript array pop
- deep clone javascript object
- mongoose nullable
- Truthy and Falsy js
- nativescript vue get native from ref
- js navigate to another page
- js unique using set
- js query string
- javascript reference file two folders up
- jquery disable enter key submit
- javascript open new window
- jquery count selected options
- petition the lord with prayer
- javascript log to console