In JavaScript, improper use of single quotes and double quotes may result in js Code conflicts and JavaScript cannot run correctly. It is easy to resolve the conflict between single quotes and double quotes in JavaScript, we only need to use
Show about the display of double quotes and single quotes in the input box
Foreground display Solution:
method One:
single quotes double quotes Method II:
single quotes double quotes
from the background to read the data foreground
About displaying double quotes and single quotes in an input box
Foreground Display Solution:
Method One:
Single quotation mark
Double quotes
Method Two:
Single quotes
Double quotes
Read foreground display solution from background:
We should add
Excerpt from: http://blog.csdn.net/changhong009/article/details/46004343' ----Single quotation mark$ #39; ----single quotes (ie compatible)" -----double QuotesA button in a webpage that writes the handling code of the onclick event is
If an attribute in the JSON object contains double quotes when converted to a string, the backslash is automatically added, please see this article in detail 1. If there are attributes in the JSON object that contain double quotes, such as the
Nested
The single quote ' ASCII code is 39 double quotes ' ASCII is 34, so we can use the form of & #xxx to replace the specific symbol. Although it becomes a & #xxx, it is still very careful in nested environments. The quotes in the code here
1. If there are attributes in the JSON object that contain double quotes, such as
Copy Code code as follows:
{
"description": "25" "
}
If converted to a string form, the backslash is automatically added to "25\" and then
Grammarstring. Replace (searchvalue,newvalue)parameter ValuesSearchvalueHave to. A RegExp object that specifies the substring or pattern to replace. Note that if the value is a string, it is used as the direct volume text pattern to be retrieved,
String.Replace () Introduction
Grammar:
String.Replace (RegExp, replacement)
RegExp: The regular expression for which you want to perform the substitution operation. If a string is passed in, it is treated as a normal character, and only one
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.