For example: Location.href=encodeuri ("http://cang.baidu.com/do/s?word= Baidu &ct=21");
3, JS use of data can be used escape[huoho.com edit]
For example: History records in the search of Tibet.
4, Escape to encode the Unicode value other than 0-255, output%u**** format, in other cases escape,encodeuri,encodeuricomponent encoding results are the same.
The most used should be encodeuricomponent, which is to convert Chinese, Korean and other special characters into utf-8 format URL encoding, So if you need to use encodeURIComponent when passing parameters to the background, you need background decoding for utf-8 support (the form is encoded in the same way as the current page encoding)
Escape does not encode 69 characters: *,+,-,.,/,@,_,0-9,a-z,a-z
There are 82 encodeURI not encoded characters:!,#,$,&, ', (,), *,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,a-z
There are 71 encodeuricomponent characters that are not encoded:!, ', (,), *,-,.,_,~,0-9,a-z,a-z
Returns the decoded string from a string object encoded with the escape method.
function unescape (charstring:string): String
Parameters
Charstring
Must be selected. The String object or text to decode.
Note
The Unescape method returns a string value containing the charstring content. All characters encoded in%XX 16 are replaced with the equivalent characters in the ASCII character set. Characters encoded in%UXXXX format (Unicode characters) are replaced with Unicode characters in hexadecimal-encoded XXXX. Note the Unescape method should not be used to decode the Uniform Resource Identifier (URI). Use the decodeURI and decodeURIComponent methods instead.
decodeURI method
Returns the encoded form of a Uniform Resource Identifier (URI).
function decodeURI (uristring:string): String
Parameters
Uristring
Must be selected. A string representing the encoded URI.
Note
Replaces the outdated unescape method with the decodeURI method.
The decodeURI method returns a string value.
If the uristring is invalid, urierror will occur.
decodeURIComponent method
Returns the non-encoded form of an encoded component of a Uniform Resource Identifier (URI).
function decodeURIComponent (encodeduristring:string): String
The required encodeduristring parameter is a value that represents the encoded URI component.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.