console.log

Discussions about Forms Designer for SharePoint 2010.
Locked
User avatar
Sebastian Haugland
Posts: 43
Joined: Fri Sep 19, 2014
Contact:

01 Oct 2015

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?

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

01 Oct 2015

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests