Contains single quotes () or double quotation marks (& quot;), which may cause JavaScript errors. This is generally solved by using or & quot;. When JavaScript is used to display messages or transmit character data, it is often encountered that the data contains single quotation marks (') or double quotation marks ("), such statements often cause JavaScript errors. This is generally solved by/'or.
For example:
Alert("this is test "message"!"); Alert('this is test 'message'!');
It is generally changed to the following statement:
Alert ("this is test/" message /"! "); // Or Alert (" this is test 'message '! "); Alert ('this is test/'message /'! ');
If the preceding code is only used in the script or does not have too complex data character connections, this problem has been solved.
However, if complicated data character connections exist, you can consider the single quotation marks (') and double quotation marks (") when using some JavaScript statements combined by the server ("), output with an escape sequence (escape sequence.
For example, the preceding statement can be converted into the following format:
Alert("this is test /u0022message/u0022!"); Alert('this is test /u0027message/u0027!');
Add some common codes
Character Description Unicode escape sequence
Long dash (-)/u2014
Registration symbol (R)/u00AE
Copyright symbol (c)/u00A9
Trademark (?) /U2122
Euro sign (?) /U20AC
Backslash (/)/u005C
Forward slash (/)/u002F
Left braces ({)/u007B
Right braces (})/u007D
Yu no. (<)/u003C
Greater than (>)/u003E
Asterisk (*)/u002A
&&
''(/U0027)
"" (/U0022)
<
>