encodeURI() 函数

2018-09-28  本文已影响7人  遥远不是北_

定义和用法

注意:
使用 encodeURI() 对 URI 进行编码:
<script type="text/javascript">

document.write(encodeURI("http://www.deer.com.cn")+ "<br />")
document.write(encodeURI("http://www.deer.com.cn/My first/"))
document.write(encodeURI(",/?:@&=+$#"))

</script>

输出结果:

http://www.deer.com.cn
http://www.deer.com.cn/My%20first/
,/?:@&=+$#
上一篇下一篇

猜你喜欢

热点阅读