1. escape encodes characters other than ansi 0-and outputs the unicode value in % u *** format. The escape method returns a string value (in Unicode format) containing charstring content ). All spaces, punctuation marks, accents, and other non-ASCII characters are replaced by % xx encoding. xx equals to the hexadecimal number of the character. For example, "% 20" is returned by a space"
Escape unencoded characters are 69: *, +,-,.,/, @, _, 0-9, a-z, A-Z
2. encodeURI is similar to escape and used for address bar encoding.
EncodeURI is not encoded with 82 characters :!, #, $, &, ', (,), *, +,-,.,/,:,;, = ,?, @,_,~, 0-9, a-z, A-Z
3. encodeURIComponent is used for address bar encoding. Encodes a text string into a valid component of a uniform resource identifier (URI. It converts special characters such as Chinese and Korean into UTF-8 url encoding. If your page encoding is gb2312, the server will receive garbled characters.
EncodeURIComponent has 71 unencoded characters :!, ',(,),*,-,.,_,~, 0-9, a-z, A-Z
Therefore, js can use escape when using data. For address bar data, it is best to use encodeURIComponent for encoding.