console
doesn't exist in IE unless the console is actually open
check this link for a detailed discussion:
Internet Explorer: "console is not defined" Error
to check whether console is defined or not, you can do
if ('console' in window)
Question
I am trying log json data onto console using following code and I want to debug it using developers tool provided by IE.
My Code is
$.getJSON("s13.aspx", function (data3, textStatus3) {
console.log(textStatus3);}
But I am having error that console is undefined.
Why is it happening? How to solve it?
Solution 2
console
doesn't exist in IE unless the console is actually open
check this link for a detailed discussion:
Internet Explorer: "console is not defined" Error
to check whether console is defined or not, you can do
if ('console' in window)
OTHER TIPS
Use if(window.console) first.
if( window.console ){
console.log('hi');
}else{
alert('console not avaliable');
}