Generally:
When Javascript is referenced, the character encoding is inconsistent. That is, the page encoding is inconsistent with the JS file encoding.
Other instructions on the Internet are as follows:
1. The character languages used for JavaScript reference are inconsistent.
For example, <SCRIPT type = "text/JavaScript" 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.
2.JavascriptWhen HTML characters are output, 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.