Home > Web Front-end > JS Tutorial > Possible causes of errors that cannot be found during javascript debugging_javascript tips

Possible causes of errors that cannot be found during javascript debugging_javascript tips

WBOY
Release: 2016-05-16 17:08:46
Original
1202 people have browsed it

Yesterday, when I was writing a very simple html page and adding some basic javascript scripts, I found that the script could not be run. It took me more than an hour to find out where the error was. Simply give code similar to the following and see if you can find the problem?
Possible causes of errors that cannot be found during javascript debugging_javascript tips
Did you notice it after looking carefully? It turns out that there is a semicolon that was entered in Chinese mode, but the difference between the two semicolons in notepad is not very obvious, especially when the code is long and it is more difficult to find. If you say you don’t enable the Chinese input method, wouldn’t it be over? But if the two alerts in the picture above require you to prompt in Chinese instead of English, you will inevitably need to switch between Chinese and English input, so there are potential risks. It has also improved.

So, the next time you can't find a possible problem in js, don't forget that it is probably caused by this annoying little problem, use ctrl F to ';' to ';' Replacement can solve the problem faster. Hope it will be helpful to you in the future.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template