Unexpected identifier problem with javascript

When running the written javascript code under chrome, sometimes an "Uncaught SyntaxError: Unexpected identifier" error message appears under the tool javascript console. After I repeatedly checked the code, I finally found that the code is missing a "," (English comma) .

After reviewing on the Internet, there are also articles that indicate that if the exception appears in define, it is mostly because you are missing a comma in the previous line of the line.

Very upset

 

The following error appears in js:

Uncaught SyntaxError: Unexpected identifier Possible causes are:

It may be of type string, but without double quotes.

Such as:

document.getElementById('s3_selectCustomName').value=customName;

The above error may occur. Correction method:

document.getElementById('s3_selectCustomName').value="customName";

That's it!

Published 248 original articles · Like 602 · Visit 1.08 million +

Guess you like

Origin blog.csdn.net/qq_32963841/article/details/104393186