Analysis of "unended string constants"
For JavaScript debugging, skip "uncompleted string constants". Detailed analysis: Action sets a data request. setattribute ("sendokmsg", sendokmsg); To Display alert ("<%= (string) request in JavaScript. getattribute ("sendokmsg") %> "), the title is displayed. However, <% SYSTEM. Out. println (string) request. getattribute ("sendokmsg"); %> can be displayed on the console.
Why:
Cause of "unended String constant" error:
1. When Javascript is referenced, the character languages used 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. 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
What I encountered today is this situation. because the data obtained is passed to a function as a parameter, 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 rows of data are used during the test and the carriage return link is used for line feed. because it contains line breaks
For the 3rd cases, my solution is:
1. Instead of directly passing the data as parameters, the data is first assigned to a hidden text. You only need to read the content of the text in the function to be called.
2. Transfer the information without special symbols and resolve the group to Js.