Summarize the "unended string constants" in javascript in the WEB program ".
1. When JAVASCRIPT is referenced, the character languages used are inconsistent.
For example, <script type = "text/javasAlias "src =" xxx. js "charset =" UTF-8 ">. xxx. js file is used inside the GB2312 format, calling outside is used UTF-8, so some special characters inside the file because of inconsistent formats, garbled, this cause.
Helper House: http://www.bkjia.com/
During the development process, I encountered that the js file contains a Chinese font, and the reference part of the js file did not specify the character set for calling the js file. All of these errors resulted in this error.
2. When JAVASCRIPT outputs HTML characters, the front and back labels do not match.
This is common. when outputting a string, single quotation marks (') or double quotation marks (") are not paired, or. when writing (), the single quotation mark (') or double quotation mark (") is not correctly output (")
3. HTML markup language or line break in the Parameter
This is the case I encountered today, because the data I got is passed to a function as a parameter. As a result, the data contains a line break, causing this error.
For example, it is normal to use only a single row of data during the test. This error is not reported ,.
This error occurs when multiple lines of data are used during the test and the carriage return link is used for line feed.
In 3rd cases, my solution is to assign a value to a hidden text instead of passing the data as a parameter, you only need to read the content in the text in the function to be called.
At first, I was confused about this error and it was difficult to debug it.