如何在 Google Chrome JavaScript 控制台中打印调试消息? [英] How do I print debug messages in the Google Chrome JavaScript Console?
问题描述
如何在 Google Chrome JavaScript 控制台中打印调试消息?
请注意,JavaScript 控制台与 JavaScript 调试器不同;它们有不同的语法 AFAIK,因此 JavaScript 调试器中的 print 命令在这里不起作用.在 JavaScript 控制台中,print()
会将参数发送到打印机.
从浏览器地址栏执行以下代码:
<前>javascript: console.log(2);成功地将消息打印到 Google Chrome 中的JavaScript 控制台".
How do I print debug messages in the Google Chrome JavaScript Console?
Please note that the JavaScript Console is not the same as the JavaScript Debugger; they have different syntaxes AFAIK, so the print command in JavaScript Debugger will not work here. In the JavaScript Console, print()
will send the parameter to the printer.
Executing following code from the browser address bar:
javascript: console.log(2);
successfully prints message to the "JavaScript Console" in Google Chrome.
这篇关于如何在 Google Chrome JavaScript 控制台中打印调试消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!