📜  从 javascript 代码示例中的链接读取数据

📅  最后修改于: 2022-03-11 15:01:45.236000             🧑  作者: Mango

代码示例2
# running on https://www.example.com?name=n1&name=n2
let params = new URLSearchParams(location.search);
params.get('name') # => "n1"
params.getAll('name') # => ["n1", "n2"]