1.特點
- Global全局對象中封裝的方法不需要對象就可以直接調用。
<script>
//例如把字符串編碼爲 URI。然後解碼某個編碼的 URI。
var strencode = encodeURI("http://blog.csdn.net?wd=張三");
document.write(strencode);//輸出:http://blog.csdn.net?wd=%E5%BC%A0%E4%B8%89
var strdecode = decodeURI(strencode);
document.write(strdecode);//輸出:http://blog.csdn.net?wd=張三
</script>
2.方法
文檔鏈接:click me
關於js編碼解碼decodeURI()與decodeURIComponent()的區別:click me