This article introduces how to solve the single quotation marks and double quotation marks conflict in Javascript. If you need it, you can refer to how to solve the single quotation marks and double quotation marks conflict in Javascript. Think about the following code:
The Code is as follows:
Html + = 'cancel ';
This is the code in js. If you write this code here, a js error will be prompted because the parameters in the removeOpenCss method do not have single or double quotes. If you write this code here:
The Code is as follows:
Html + = 'cancel ';
An error is reported directly, because the single cited and double cited conflicts here, so I only solve this problem through:
The Code is as follows:
Html + = 'cancel ';
In JavaScript, an error occurs when two double quotation marks are nested.
The following solutions are available:
Replace the inner single quotes'
Replace double quotation marks"
The following is an example.
The Code is as follows:
<BR> JavaScript single quotes and double quotation marks </P> <P>
Script
Function showmSG (S)
{
Alert (S );
}
Script