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 |