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.