I. Basic Concepts encodeURI and decodeURI are used in pairs, because the address bar of a Browser contains Chinese characters, unexpected errors may occur, therefore, encodeURI can convert non-English characters into English encoding, and decodeURI can be used to restore the characters. EncodeURI party... SyntaxHighlighte
I. Basic Concepts
EncodeURI and decodeURI are used in pairs. Because the address bar of the Browser contains Chinese characters, unexpected errors may occur. Therefore, encodeURI can convert non-English characters into English encoding, decodeURI can be used to restore characters. The encodeURI method does not encode the following characters: ":", "/", ";", and "? The encodeURIComponent method can encode these characters.
The decodeURI () method is equivalent to java.net. URLDecoder. decode (URIString, "UTF-8 ");
The encodeURI () method is equivalent to java.net. URLEncoder. encode (URIString, "UTF-8 ");
Ii. Example