1// https://testsite.com/users?page=10&pagesize=25&order=asc
2const urlParams = new URLSearchParams(window.location.search);
3const pageSize = urlParams.get('pageSize');
1const queryString = window.location.search;
2const urlParams = new URLSearchParams(queryString);
3const code = urlParams.get('code')
1let url = 'https://www.example.com?name=n1&name=n2';
2let params = (new URL(url)).searchParams;
3params.get('name') // "n1"
4params.getAll('name') // ["n1", "n2"]
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);