为什么timeperiod为null
const url = 'http://example.com?timeperiod=lasttwentyeightdays&pagesize=20'
const args = new URLSearchParams(url);
alert('timeperiod='+args.get('timeperiod') + ' and pagesize='+ args.get('pagesize'));
但是在下面的代码中它可以工作
const url = 'http://example.com?x=c&timeperiod=lasttwentyeightdays&pagesize=20'
const args = new URLSearchParams(url);
alert('timeperiod='+args.get('timeperiod') + ' and pagesize='+ args.get('pagesize'));