html, javascript, URL special character escapes in the actual programming are useful, some people on the use of special character escapes is not very clear, the following on the escape of Html,javascript,url special characters to do a description and Induction.
HTML special character escapes
HTML special character escapes are formatted as Follows:
& + Entities (entity) or # Plus entities (entity) + ";" For example,:& escaped and became & amp;
Still remember just learn HTML that will, do page layout, need to use a lot of space, so you keep pressing the space to affect the layout, but see the effect has not changed. The reason is that when HTML encounters multiple spaces between two characters, it is parsed into a single space. There are students on the point, the space for & nbsp, and then copied a large number of & nbsp, The effect is realized, think of the original HTML is how Simple.
The following are common HTML escape characters:
Character |
Description |
Escape character |
" |
Double quotes |
" |
& |
& Symbols |
& |
< |
Less than |
&amp;lt; |
> |
Greater than |
&amp;gt; |
|
A blank grid that keeps on line |
&amp;nbsp; |
‘ |
Single quotation marks |
&amp;acute; |
? |
Copyright |
&amp;copy; |
? |
Registered trademarks |
&amp;reg; |
Javascrpt Escape character
The following lists the commonly used escape characters in JavaScript
Escape sequences |
Character |
\b |
Backspace |
\f |
Go paper To change pages |
\ n |
Line break |
\ r |
Enter |
\ t |
Horizontal Jump Grid |
\‘ |
Single quotation marks |
\" |
Double quotes |
\\ |
Back slash |
Note: the difference between line break (\ N) and carriage return (\ R)
The story of this thing comes from a typewriter, and there are two steps in the old typewriter to start a new line:
1. Type the head back to the starting position, this is the carriage return
2. Move the paper up one line, this is the line
URL special character escapes
When you submit the form by get, the browser will use the HTTP protocol to parse the URL parameters in the & symbol, and then upload to the server, the server gets the corresponding Value. If the & character usage is unreasonable, the server will not get the corresponding value after the HTTP protocol parsing.
For example:
http://jahan.sinaapp.com/test.php?content= me and you//content= me and you
http://jahan.sinaapp.com/test.php?content=i&you//content=i, you= ';
This violates our intentions, and what we want is i&you, so it is necessary to master and understand URL Escapes.
URL Special character encoding Formula:
URL Special character encoding formula =% + character ASCII (16 Binary) code value
For example: the encoded value of a space is "%20".
Some URL special symbols and codes are listed in the following Table.
Special characters |
Description |
16 Binary values |
+ |
The + sign in the URL denotes a space |
%2b |
Space |
Spaces in the URL can be used with a + or code |
%20 |
/ |
Separating directories and subdirectories |
%2f |
? |
Separating the actual URLs and parameters |
%3f |
% |
Specify special characters |
%25 |
# |
Represents a bookmark |
%23 |
& |
Delimiter between the parameters specified in the URL |
%26 |
= |
The value of the specified parameter in the URL |
%3d |
The above is the html, javascript, URL special character escape or coding summary, summed up, oneself also suddenly dawned, the original before appeared all sorts of problems is because this or why will deal with, hope to you, to my own help.
HTML special character escaping problem (go!) )