📅  最后修改于: 2022-03-11 15:01:27.895000             🧑  作者: Mango
// https://www.example.com?name=n1&name=n2
let params = new URLSearchParams(location.search);
params.get('name') // => "n1"
params.getAll('name') // => ["n1", "n2"]
// SOURCE : https://stackoverflow.com/questions/814613/how-to-read-get-data-from-a-url-using-javascript
// REPLY : Franklin Yu