??JavaScript???UrlDecode,???????decodeURIComponent????????????URL??????????
??,?????URL?????,????????:
const url = 'https://example.com/?name=John Doe&age=30'; const decodedName = decodeURIComponent(url.split('=')[1]); console.log(decodedName); // John Doe
????split??????????,?????URLSearchParams????????URL????????:
const url = 'https://example.com/?name=John Doe&age=30'; const searchParams = new URLSearchParams(url); const decodedName = decodeURIComponent(searchParams.get('name')); console.log(decodedName); // John Doe
????????,????JavaScript?????URL???????