Site behaves differently when developer tools are open IE11

poptarts picture poptarts · Jul 28, 2015 · Viewed 12.3k times · Source

Im using the following template in IE11 and can not figure out why the sidebar sings in every time navigation is happening. When developer tools are open it behaves as I would like it to. It is easily demoed by clicking on any one of the tabs under UI element in the tree while running IE11. However you will notice if F12 developer tools are open the side bar does not slide in every time navigation happens. This is not an issue in chrome. There is an error with fastclick that may show up however I have ran without fastclick and it still happens. Any help would be great. Thanks. https://almsaeedstudio.com/themes/AdminLTE/pages/UI/general.html

Answer

sam100rav picture sam100rav · Jul 28, 2015

Try removing any console.log() from your code.

console.log() which is to help out when debugging Javascript can cause IE to completely stop processing scripts on the page. To add to the mystery, if you keep watching your page in IE with devtools open - you won’t notice an issue at all.

Explanation

The reason for this is the console object is not instantiated unless devtools is open in IE. Otherwise, you will see one of two things:

  1. Javascript won’t execute correctly
  2. Console has cryptic errors, such as ‘object is undefined’ or others of that nature

Nine times out of ten, you have an errant console.log in the code somewhere. This does not affect any browser other than IE.