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
WBOYOriginal
2016-05-16 18:52:261404browse
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 "

Statement:
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