decodeURI() 函數(shù)可對(duì) encodeURI() 函數(shù)編碼過(guò)的 URI 進(jìn)行解碼。
decodeURI(URIstring)
參數(shù) | 描述 |
---|---|
URIstring | 必需。一個(gè)字符串,含有要解碼的 URI 或其他要解碼的文本。 |
URIstring 的副本,其中的十六進(jìn)制轉(zhuǎn)義序列將被它們表示的字符替換。
在本例中,我們將使用 decodeURI() 對(duì)一個(gè)編碼后的 URI 進(jìn)行解碼:
<script type="text/javascript"> var test1="http://theartemis.cn/My first/" document.write(encodeURI(test1)
+ "<br />") document.write(decodeURI(test1)
) </script>
輸出:
http://theartemis.cn/My%20first/ http://theartemis.cn/My first/
如對(duì)本文有疑問(wèn),請(qǐng)?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會(huì)為你解答?。?點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號(hào)