jquery获取url中的参数query

利用插件 purl.js,比如获取url中传递过来的参数 id 的值,代码为:

let href = window.location.href;
let url = $.url(href);
let roleId = url.param('id');