String constant that has not ended in Javascript

Source: Internet
Author: User

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.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.