I’m writing a web application platform that serves JavaScript applications to a browser. Needless to say, I launch an application with a JS method after the document has loaded, but on IE9 nothing happens if the developer console hasn’t been fiddled with.
This seems like the typical missing console problem, but I couldn’t fix it by adding a check for console or removing console calls from the source code.
Can you guys spot where I’m going wrong?
- The site: http://eiskis.net/proot/pika/proot/
- JS source: http://eiskis.net/proot/pika/proot/assets/behavior
I’m serving multiple separate web apps with the same platform, so you can also check out the following (the problem appears the same all over):
Object.keys is not supported in all versions of internet explorer :
Please refer to the following : https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys
The following (from the source mentioned above) adds Object.keys to the browsers that do not support it :
In addition, your method of checking the existence of console is erroneous :
Try running (http://jsfiddle.net/PytAh/) in internet explorer:
if (console){ alert("there"); } else { alert("not there"); }It will generate an error showing that console does not exist.
You can replace it by :
if (window.console){ alert("there"); } else { alert("not there"); }