Home > Web Front-end > JS Tutorial > JavaScript outputs single quotes and double quotes in complex nested environments_javascript skills

JavaScript outputs single quotes and double quotes in complex nested environments_javascript skills

WBOY
Release: 2016-05-16 18:52:26
Original
1403 people have browsed it
Nesting of quotation marks

The ASCII code of single quotation mark ' is 39 and the ASCII code of double quotation mark " is 34, so we can use the form of xx; to replace the specific symbol. Although It becomes the form of xx;, but you still have to be careful in a nested environment. The quotation marks used in alert() in the code here are single quotation marks, and the string in alert should escape the single quotation marks. ' form. Otherwise, escape "

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template