Use console. Log () carefully in IE 8 ()

Source: Internet
Author: User

In many cases, we use console. Log () to debug the code. There won't be much problem in chrome and Firefox, but recently I used console. Log () for debugging in IE8, and some problems have arisen. To debug code using IE8, you must enable F12 first. If F12 is not enabled, an error is displayed below the browser. This is because IE8 will process console. Log () as the error logic by default, but in F12, it will process it as the console output. Interestingly, however, we disable F12 and refresh the page. IE8 still uses the console. log () is output on the console. Once F12 is opened, the console is always recognized. log (). Therefore, we often forget to delete the console. Log () statement after debugging.

How to reproduce an error: After F12 is enabled, console. Log () is identified (). We need to clear the browser cache and restart the browser. If we do not open F12, it will reappear.

What we should do is to develop good programming habits and do not abuse console. Log (). After debugging, remember to comment out or delete the debugging code.

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.