How would I get the params in a URL that are encoded. Eg, in this URL, I want the 2 cf=
and the 3 cat=
values:
search.php?st=advanced&qall=&qany=&cat%5B%5D=13&cat%5B%5D=14&cat%5B%5D=11&cf%5B%5D=16&cf%5B%5D=22
I tried this and get null:
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
console.log(urlParams.get(`cat%5B%5D`)); // would like array [13,14,11]
console.log(urlParams.get(`cf%5B%5D`)); // would like array [16,22]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…