JavaScript encodeURI() 函数
encodeURI() 函数可把字符串作为 URI 进行编码。
--------------------------------------------------------------------------------------------
输入:
<script type="text/javascript">
document.write(encodeURI("http://www.w3school.com.cn")+ "<br />")
document.write(encodeURI("http://www.w3school.com.cn/My first/"))
document.write(encodeURI(",/?:@&=+$#"))
</script>
-------------------------------------------------------------------------------------------------
输出:
http://www.w3school.com.cn
http://www.w3school.com.cn/My%20first/
,/?:@&=+$#

浙公网安备 33010602011771号