There are no possible causes for error during JavaScript debugging _javascript tips

Source: Internet
Author: User
Yesterday, when writing a very simple HTML page with some basic JavaScript scripts, it took 1 hours to find out where the error was. Simply give the following similar code to see if you can find the problem there?

Look carefully and then find out. There is a semicolon is entered in Chinese mode, and in Notepad, the difference between the two semicolons is not very obvious, especially in the age of the code is more difficult to find. If you say that does not open the Chinese input method is not finished, but if the above two alert all need you to hint is Chinese instead of English, this will inevitably need to switch between the English input, so the potential risk is promoted.

So, the next time you can not find a problem in JS, do not forget that it is likely to be such a nasty little problem caused by the full text of Ctrl+f '; Replacement can solve the problem more quickly. I hope it will be helpful to you in future.
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.