用的時候總想起不來,記個筆記。
encodeURIComponent() 函數可把字符串作爲 URI 組件進行編碼。
encodeURIComponent(URIstring)
encodeURIComponent('http://localhost:8000/pointCloudPlat');
//===>
// http%3A%2F%2Flocalhost%3A8000%2FpointCloudPlat
decodeURIComponent() 函數可對 encodeURIComponent() 函數編碼的 URI 進行解碼。
decodeURIComponent(URIstring)
decodeURIComponent('http%3A%2F%2Flocalhost%3A8000%2FpointCloudPlat');
//===>
// http://localhost:8000/pointCloudPlat