通过链接给网页传递参数
网页内通过js脚本获取参数
// 创建URLSearchParams对象
const params = new URLSearchParams(window.location.search);
// 读取参数值“abc.txt”
const file = params.get('file'); 多个参数传递使用&连接
判断是否有参数
const params = new URLSearchParams(window.location.search);
const file = params.get('file');
if(file.trim().length != 0){
//有参数
}