Page 1 of 1

console.log

Posted: 01 Oct 2015
by Sebastian Haugland
Hi

While devoloping I am using alert to read of varables as I got error when I tried to use console.log is there a subsitute for console.log?

Re: console.log

Posted: 01 Oct 2015
by rostislav
The error probably occurs when your console is not open? SP2010 opens in IE in IE8 compatibility mode, and IE8 doesn't have the console object created unless the console is opened, hence you're getting the error. Add a check to get rid of the errors:

Code: Select all

 if (window.console) {
 console.log('your message');
 }
and keep your console open to not miss any messages.