I just started playing around with IE10 on Win8 and ran into problem. The developer tools console doesn't seem to work when the Document Mode is set to Standards. I've played around with both the Browser Mode and the Document Mode, and console works when Set as IE9 Standards, but setting it to simply "Standards", the default for IE10, console is undefined. Any ideas?
This is not a duplicate. When testing, developer console is open. Switching Doc mode to IE9 standards and reloading displays console output as expected. Switching back to IE10 standards displays no console output. Debugging shows console is undefined which thus sets console.log to an empty function to handle the undefined. I'm curious as to why the console is undefined when in IE10 standards mode.
I'm running Win8 in a VirtualBox. My page is HTML4 markup with appropriate doctype.
You can access IE8 script console by launching the "Developer Tools" (F12). Click the "Script" tab, then click "Console" on the right. Also, you can clear the Console by calling console.
A variable that has not been assigned a value is of type undefined . A method or statement also returns undefined if the variable that is being evaluated does not have an assigned value. A function returns undefined if a value was not returned .
The reason why console.log();
is undefined is because that's how standards mode works. IE 8 has a compatibility mode that literally turns it into IE 7, removing all understanding of features added to IE 8. The console was added in IE 10, so by running it in standards mode, it would make sense for it to throw errors.
<head>
<title>Force IE 10</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
This meta tag up here will force IE to run in the most recent version you have installed (disabling standards and compatibility mode). This is the only way to have your console defined in IE 10 in standards mode — by disabling standards mode.
define it!
if (typeof console == "undefined") {
this.console = {log: function() {}};
}
see : 'console' is undefined error for Internet Explorer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With