Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Console.log not working in Chrome

I'm trying to log some data from my javascript code to check if its right, but it doesn't seem to be working. Even when I type into the console:

console.log("hello");

the console just returns undefined (which is correct) but it also doesn't log the "hello". If it matters, I'm using adblock and hoverzoom as my extensions. Also, I'm on a macbook pro. Any ideas on why this doesn't work?

like image 375
Cristiano Avatar asked Apr 01 '13 15:04

Cristiano


People also ask

How do I enable console debugging in Chrome?

Click the Console tab. Press Control + [ or Command + [ (Mac) until the Console is in focus. Open the Command Menu, start typing Console , select the Show Console Panel command, and then press Enter .

Why is my console log undefined?

This is because console. log() does not return a value (i.e. returns undefined). The result of whatever you entered to the console is first printed to the console, then a bit later the message from console. log reaches the console and is printed as well.


1 Answers

Most likely, you have some JavaScript in your code that overwrites console.log for compatibility reasons (this will also affect the console of the application's tab). You can verify that by pressing F12 in this tab and checking that console.log still works fine.

like image 142
phihag Avatar answered Oct 01 '22 20:10

phihag