js get url variables
var url_string = "http://www.example.com/t.html?a=1&b=3&c=m2-m3-m4-m5"; //window.location.href
var url = new URL(url_string);
var c = url.searchParams.get("c");
console.log(c);const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const code = urlParams.get('code')const postID = (new URLSearchParams(window.location.search)).get('post');examplepage.php?var1=value&var2=value
Also in JavaScript:
- $set
- javascript redirection
- javascript Convert an array of objects to a single object
- javascript substring vs substr
- javascript get random array value
- layer on top in javascript
- atom javascript es6 linter
- how to make a component reload in angular
- map a square to a circle
- javascript if equal infinity
- get url params angular
- javascript url check
- loop async javascript
- javascript reduce sur un tableau d'objet
- create 2d array in javascript filled with 0
- how to get form all filed with properties in jquery
- moment js check if date is greater than
- how to print to screen in javascript
- convert an array to uppercase or lowercase js
- how to lock device orientation using css and javascript
- 2. When will the validation functions be called in the react js
- how to change background image dynamically in react
- jquery checkbox unchecked
- jquery wait for all ajax requests to complete