When you use JavaScript to make GET requests, you’ll often run into the fact that JavaScript requires the URL to be encoded. For functions that need an encoded URL, you can use encodeURIComponent to encode it.
. encodeURIComponent syntax:
var 儲存用變數=encodeURIComponent("被加密網址").
.
Example:
Paste the following code into the address bar
javascript:alert(encodeURIComponent(location.href));
You can also use decodeURIComponwent to restore a URL that was encoded with encodeURIComponent.
The syntax is the same as encodeURIComponent:
var 儲存用變數=encodeURIComponent("被加密網址")



