这不是一个与WordPress相关的问题,但你可以这样做
// creates a object from the array, one of the properies (search) contains the query
let url = new URL(\'https://dev/job/?job_id=jkdbsbd45JubJKAAASSYT\');
// will create a object of all availalble query properites
const urlSearchParams = new URLSearchParams(url.search);
const params = Object.fromEntries(urlSearchParams.entries());
// remove ? and everything after from url
url = url.href.substring(0, url.href.indexOf(\'?\'));
// url + params.job_id is the final url, did a console.log so you could see it in the devtools console
console.log(url + params.job_id);