javascript get token from query string

Solutions on MaxInterview for javascript get token from query string by the best coders in the world

showing results for - "javascript get token from query string"
Aubrey
05 Apr 2018
1const queryString = window.location.search;
2console.log(queryString);
3// ?product=shirt&color=blue&newuser&size=m
4
Veronica
05 Jun 2019
1const urlParams = new URLSearchParams(queryString);
2
Élodie
20 Sep 2018
1const product = urlParams.get('product')
2console.log(product);
3// shirt
4
5const color = urlParams.get('color')
6console.log(color);
7// blue
8
9const newUser = urlParams.get('newuser')
10console.log(newUser);
11// empty string
12