Console.log无法在Chrome中使用 [英] Console.log not working in Chrome
问题描述
我正在尝试从我的JavaScript代码中记录一些数据,以检查它是否正确,但似乎没有工作。即使当我输入控制台时:
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");
控制台只返回undefined(这是正确的),但它也不会记录hello 。如果重要,我使用adblock和hoverzoom作为我的扩展。另外,我在MacBook Pro上。任何想法,为什么这不起作用?
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?
推荐答案
很可能,您的代码中有一些JavaScript覆盖 console.log
出于兼容性原因(这也会影响应用程序选项卡的控制台)。您可以通过在此选项卡中按 F12 并检查 console.log
仍然正常工作来验证。
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.
这篇关于Console.log无法在Chrome中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!