1const queryString = window.location.search;
2const urlParams = new URLSearchParams(queryString);
3const code = urlParams.get('code')
1// Example URL: https://example.com/over/there?name=ferret
2const queryString = window.location.search;
3const urlParams = new URLSearchParams(queryString);
4const parameter_name = urlParams.get('name')
5console.log(parameter_name);
1var url_string = "http://www.example.com/t.html?a=1&b=3&c=m2-m3-m4-m5"; //window.location.href
2var url = new URL(url_string);
3var c = url.searchParams.get("c");
4console.log(c);
1const queryString = window.location.search;
2
3const urlParams = new URLSearchParams(queryString);
4
5const page_type = urlParams.get('page_type')
6
7console.log(page_type);