234234234

js 获取浏览器路径参数,一行代码解决

 

location.search
            .replace('?', '')
            .split('&')
            .reduce((ret, item) => {
                const [key, value] = `${item}`.split('=');
                ret[key] = value;
                return ret;
            }, {});

 

posted @ 2024-04-26 13:14  你若愿意,我一定去  阅读(7)  评论(0编辑  收藏  举报
23423423423