Jump to content
Larry Ullman's Book Forums

Console.Log And Ie9 Problems


Recommended Posts

I use the console.log function with Firebug all over the place in my javascript/jquery without any problems, I couldn't develop without it really. I am just finishing up a major project and decided I better test this app on IE. My javascript files choked as the page loaded and I got an unresponsive browser. After a panicky debugging session, I found that IE was throwing a "console undefined" error. I commented out all of my console.log function calls and all is well now.

 

Strange thing though...when I activated the developer console while using (in this case) IE9, my javascript worked okay and my calls to console.log were logged to the console. This confused me because it appeared that my javascript was working fine. If I closed the developer console the javascript would continue to work just fine. If I refreshed the browser with the developer console closed the javascript files with the calls to console.log would stop working again.

 

I thought that console.log should work on all modern browsers. Is IE9 not considered a modern browser? I could live just fine without IE if everybody else in the world would set it ablaze. Anyone had an issue like this and if so, what is a simple way to deal with it. Thanks.

 

 

Link to comment
Share on other sites

Your assumption about console.log only working when the developer tools are open in IE9 is correct.

The following explains this in more detail than I can:

http://stackoverflow.com/a/5473193/1992973

 

Also, IE9 is considered the first IE browser that's a modern browser because it contains HTML5 element support as well as things like the canvas element, etc.

With that said though, by today's standards, it's lacking a lot (although IE10 and IE11 are pretty decent browsers).

Link to comment
Share on other sites

Thanks HartleySan, that thread really sums it up. Looks like a few others over at SO have had a head scratching time with this issue also. I looked around over there, but didn't find that thread. Now it all makes sense. I will adopt the "fix it all" function described in the thread at SO and include it in my scripts from now on. Thanks for your reply. Now off to break some more code... 

Link to comment
Share on other sites

 Share

×
×
  • Create New...