1// www.example.com/users?token=12345
2
3let params = (new URL(document.location)).searchParams;
4let token = params.get("token");
5// 12345
1// view.jsp?id=101
2let queryString = window.location.search;
3let urlParams = new URLSearchParams(queryString);
4let opportunity_id = urlParams.get('id');
1const queryString = window.location.search;
2const urlParams = new URLSearchParams(queryString);
3const code = urlParams.get('code')
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);