JavaScript decodeURIComponent() º¯Êý

¶¨ÒåºÍÓ÷¨

decodeURIComponent() º¯Êý¿É¶Ô encodeURIComponent() º¯Êý±àÂëµÄ URI ½øÐнâÂë¡£

Óï·¨

decodeURIComponent(URIstring)
²ÎÊý ÃèÊö
URIstring ±ØÐè¡£Ò»¸ö×Ö·û´®£¬º¬ÓбàÂë URI ×é¼þ»òÆäËûÒª½âÂëµÄÎı¾¡£

·µ»ØÖµ

URIstring µÄ¸±±¾£¬ÆäÖеÄÊ®Áù½øÖÆ×ªÒåÐòÁн«±»ËüÃDZíʾµÄ×Ö·ûÌæ»»¡£

ʵÀý

ÔÚ±¾ÀýÖУ¬ÎÒÃǽ«Ê¹Óà decodeURIComponent() ¶Ô±àÂëºóµÄ URI ½øÐнâÂ룺

<script type="text/javascript">

var test1="http://www.w3school.com.cn/My first/"

document.write(encodeURIComponent(test1)+ "<br />")
document.write(decodeURIComponent(test1))

</script>

Êä³ö£º

http%3A%2F%2Fwww.w3school.com.cn%2FMy%20first%2F
http://www.w3school.com.cn/My first/

TIY

decodeURIComponent()
ÈçºÎʹÓà decodeURIComponent() ¶Ô±àÂëºóµÄ URI ½øÐнâÂë¡£
VUE