Sly
Sly

Reputation: 15217

IE 9 console is undefined

I understand what this error mean, and why it happens. The question is how to find code, that causes the error.

Are there any ideas how to find a place where console is missing and used?

Upvotes: 0

Views: 1856

Answers (3)

epascarello
epascarello

Reputation: 207511

Well console is not "missing", that is how that version of IE works.

To find where it is used:

  1. Open up the developer tools in IE.
  2. Click on the scripts tab.
  3. Use the search box.

Console Screenshot

Best practice is to not leave console lines in code. There are workarounds like checking if console is available before using it, but all that does is add overhead to your code.

Upvotes: 0

Jeremy J Starcher
Jeremy J Starcher

Reputation: 23863

Another option is to create a dummy console object with stubbed functions.

Peter Tseng's answer on this question is quite good: 'console' is undefined error for Internet Explorer

Upvotes: 0

Dmitri Tsoy
Dmitri Tsoy

Reputation: 569

Well, I would go the following way: - Save the entire webpage (including all scripts, styles and images) to the hard drive - search through the files for console.log

Upvotes: 1

Related Questions