Alibabacloud.com offers a wide variety of articles about javascript escape string for url, easily find your javascript escape string for url information here online.
Usually if something needs to be coded, it means that something is not suitable for transmission. There are a variety of reasons, such as size too large to contain private data, and for URLs, the reason for encoding is because some characters in the
DocumentWhen url is used for parameter transfer, some parameters or URL addresses with Chinese names are often passed, and conversion errors may occur during backend processing. In some transfer pages, GB2312 is used, and UTF8 is used on the
There are three functions in JavaScript that can encode strings, namely: escape,encodeuri,encodeuricomponent, corresponding 3 decoding functions: unescape,decodeuri, Decodeuricomponent.Here's a brief look at the difference between them1 Escape ()
URL encoding conversion, escape () encodeURI () encodeURIComponent ()
Escape () method:
The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters
Escape () method:The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters will be converted into character encoding in % xx format (xx equals to
Escape () method:
The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters will be converted into character encoding in % xx format (xx equals to
Escape () method:
The specified string is encoded using the ISO Latin character set. All spaces, punctuation, special characters, and other non-ASCII characters will be converted into%XX-formatted character encodings (XX equals the encoded 16 digits
URL encoding conversion, escape () encodeuri () encodeuricomponent ()
Escape () method:The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters
JS Escape Escape (), encodeURI (), encodeURIComponent () differenceThere are three functions in JavaScript that can encode strings, namely: Escape,encodeuri,encodeuricomponent, corresponding 3 decoding functions: Unescape,decodeuri,
There are three functions in JavaScript that can encode strings: escape, encodeURI, encodeURIComponent,
Corresponding three decoding functions: unescape, decodeURI, and decodeURIComponent.
The following is a brief introduction of their differences.
1
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.