We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let query = window.location.search.slice(1); let query = 'ie=utf-8&f=8&rsv_bp=1&tn=baidu&ie=wtf';
需要注意 query 是地址中 ? 之后的部分 window.location.search.slice(1) let searchParams = new URLSearchParams(query); for (let keyValue of searchParams) { console.log(keyValue); } console.log('1',searchParams.getAll('ie')); // ["utf-8", "wtf"] console.log('2',searchParams.get('tn')); // "baidu" console.log('3',searchParams.getAll('tn')); // ["baidu"]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
let query = window.location.search.slice(1);
let query = 'ie=utf-8&f=8&rsv_bp=1&tn=baidu&ie=wtf';
需要注意 query 是地址中 ? 之后的部分 window.location.search.slice(1)
let searchParams = new URLSearchParams(query);
for (let keyValue of searchParams) {
console.log(keyValue);
}
console.log('1',searchParams.getAll('ie')); // ["utf-8", "wtf"]
console.log('2',searchParams.get('tn')); // "baidu"
console.log('3',searchParams.getAll('tn')); // ["baidu"]
The text was updated successfully, but these errors were encountered: