HTML character entity and escape string

Source: Internet
Author: User
The character entity (CharacterEntities), an EscapeSequence (EscapeSequence), that is, the character entity (CharacterEntity) is divided into three parts: the first part is a & amp; ampersand. The second part is the Entity name or #
Composition of escape strings

The Character Entity is divided into three parts: the first part is an & symbol, which is called ampersand; the second part is an Entity) name or # with the Entity number; the third part is a semicolon.

For example, to display a smaller sign (<), you can write <or <.

The advantage of using an Entity name is that it is easy to understand. when you look at it, you can probably guess what it means to be less, however, not all browsers support the latest Entity names. Entity numbers can be processed by various browsers.

Tip: Entity names are case sensitive.

Note: The same symbol can be referenced by "entity name" or "Entity Number". the advantage of "Entity Name" is that it is easy to remember, but it cannot be ensured that all browsers can recognize it smoothly, and the "entity number" is not worried, but it is inconvenient to remember.

JavaScript escape character
Escape sequence Character
\ B Return
\ F Take the form of paper
\ N Line Feed
\ R Enter
\ T Horizontal hop (Ctrl-I)
\' Single quotes
\" Double quotation marks
\\ Backslash

Pay attention to special characters during programming. many running problems are caused by special characters.

Note: Because the backslash itself is used as an escape character, you cannot directly type a backslash in the script. To generate a backslash, you must enter two backslash (\) together (\\).


Encoding conversion(To Unicode)

(Program code comes from the network)

Js version

Script test = "Hello abc" str = "" for (I = 0; I
 
  

Character Entities, the most common Character entity in the HTML special escape Character list
Display Description Entity Name Entity ID
  Blank
  Wide white space
  Blank rows    
< Less < <
> Greater > >
& & Symbol & &
" Double quotation marks " "
? Copyright © ©
? Registered trademark ® ®
? Trademark (USA) ?
× Multiplication number × ×
Bytes Division number Bytes Bytes

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.