Error Console Internet Explorer 9
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us console internet explorer 11 Learn more about Stack Overflow the company Business Learn more about hiring developers javascript console internet explorer or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack how to open console on internet explorer Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Does IE9 support console.log, and is it
Internet Explorer Console Is Not Defined
a real function? up vote 180 down vote favorite 63 In which circumstances is window.console.log defined in Internet Explorer 9? Even when window.console.log is defined, window.console.log.apply and window.console.log.call are undefined. Why is this? [Related question for IE8: What happened to console.log in IE8?.] javascript logging internet-explorer-9 share|improve this question asked Mar 29 '11 at 13:03 mloughran 5,51462020 3 Check out this great post about the intricacies internet explorer console log object of IE8-9 console object/function: whattheheadsaid.com/2011/04/… –Marc Climent Dec 30 '11 at 13:37 See also 'console' is undefined error for internet explorer –Bergi Nov 10 '12 at 12:34 add a comment| 6 Answers 6 active oldest votes up vote 261 down vote accepted In Internet Explorer 9 (and 8), the console object is only exposed when the developer tools are opened for a particular tab. If you hide the developer tools window for that tab, the console object remains exposed for each page you navigate to. If you open a new tab, you must also open the developer tools for that tab in order for the console object to be exposed. The console object is not part of any standard and is an extension to the Document Object Model. Like other DOM objects, it is considered a host object and is not required to inherit from Object, nor its methods from Function, like native ECMAScript functions and objects do. This is the reason apply and call are undefined on those methods. In IE 9, most DOM objects were improved to inherit from native ECMAScript types. As the developer tools are considered an extension to IE (albeit, a
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn internet explorer console is undefined more about Stack Overflow the company Business Learn more about hiring developers or
Ieframe.dll Error Internet Explorer 9
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community
Internet Explorer 9 Download For Windows 7
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Console is undefined error in IE9 up vote 15 down http://stackoverflow.com/questions/5472938/does-ie9-support-console-log-and-is-it-a-real-function vote favorite 4 I have a graphics page which shows SVG graphics. I am using Raphael graphics framework. The page displays properly in Firefox, Also if the F12 developer tools is set 'on' in IE9 it works fine. The map show partial data (its a node link diagram and it shows only one child node out of 12 nodes) in IE9 if the F12 developer mode is set http://stackoverflow.com/questions/10183440/console-is-undefined-error-in-ie9 off and application is started with browser cache cleared (simulating a general user). Update: I kept the Debugger on and Shows me the error "Console is undefined". So I think its not a graphics rendering issue, and also I am not using the console explicitly, maybe the mindmap js is using it internally, but how to again get rid of this issue? Update: I found the issue and commented out the console.log entries from the js files. Thanks. javascript console internet-explorer-9 share|improve this question edited Apr 17 '12 at 0:38 asked Apr 17 '12 at 0:18 pri_dev 2,22174693 add a comment| 3 Answers 3 active oldest votes up vote 33 down vote accepted Probably your code or the code you are calling is using console.log or something like it. You could add this code in the global scope to create a dummy wrapper for IE (or any browser that doesn't support it). Just put the following code somewhere before you call any other libraries: if(!(window.console && console.log)) { console = { log: function(){}, debug: function(){}, info: function(){}, warn: function(){}, error: function(){} }; } share|improve this answer answered Apr 17 '12 at 0:37 Kip 52.1k69174217 add a comment| up vote 6 down vote
fixing it, I used it as an excuse to let Jamie be the IE debugging master (he just loves this). But last week we were in the final stages of QA on a project making heavy use of Backbone.js, and one of the last things http://thisbythem.com/blog/whats-up-with-the-js-console-in-ie9/ remaining was a bug that was only appearing on IE9. This bug was breaking the core functionality https://www.sitepoint.com/community/t/how-not-to-let-console-log-to-cause-error-on-ie-or-other-browsers/4307 of the app. We were crunching and Jamie was busy, so I needed to get that VMWare instance going ASAP and dig in. I used to be really good at debugging IE because I did it all the time. I used to know all the things to check and all the various hacks and such that were needed. But I was out of practice and this bug was killing internet explorer me. I was having a really hard time reproducing it. But I finally found the steps: Fire up a new IE9 session on BrowserStack (for some reason it only happened on BrowserStack for me). Login to the app. Boom. Bug. It took me a couple frustrating hours to get to this point, mind you. But once I was able to reproduce, I thought it was going to be smooth sailing to finding a fix. Not quite. If I did the above steps, but had the developer console console internet explorer open, no bug. So, sprinkling some console.log messages at various points in the execution path to find out when this was happening wasn’t possible, because the bug wasn’t happening. Eventually, I asked Jamie to pair up with me on it, and he wondered if we had any console.log calls lingering in the codebase that we had forgotten about. I wasn’t convinced that would be the issue. The fact that these console.log messages were working was what had tricked me into thinking IE9 fully supported console.log. That was where I went wrong. In IE9, window.console is defined only when the developer tools window has been opened Grrr. That’s right. I had forgotten about this. Until you open the developer tools window on IE9, the console object is undefined. That means if you try to call console.log you will get an error and execution will stop. This rogue console.log was inside of a cached callback, so we were only seeing the bug on first load. Also, if you then close the developer tools window, the console object will continue to remain available for the life of that particular browser tab. Open a new tab, and it will be gone again until you open developer tools. Here’s a thread on Stack Overflow that has some further explanation and potential workarounds if you want console.log to always work in IE9. Hopefully after writing this post I’ll never forget this again. And hopefully it won’t be long before debugging IE9 is a thing of the past. 03.10.2014 Please enable JavaScript to view the c