console.log
- Sebastian Haugland
- Posts: 43
- Joined: Fri Sep 19, 2014
- Contact:
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?
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?
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:
and keep your console open to not miss any messages.
Code: Select all
if (window.console) {
console.log('your message');
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 6 guests