Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
437 views
in Technique[技术] by (71.8m points)

javascript - 如何在Google Chrome JavaScript控制台中打印调试消息?(How do I print debug messages in the Google Chrome JavaScript Console?)

How do I print debug messages in the Google Chrome JavaScript Console?

(如何在Google Chrome JavaScript控制台中打印调试消息?)

Please note that the JavaScript Console is not the same as the JavaScript Debugger;

(请注意,JavaScript控制台与JavaScript调试器不同;)

they have different syntaxes AFAIK, so the print command in JavaScript Debugger will not work here.

(它们具有不同的语法AFAIK,因此JavaScript调试器中的print命令在此处不起作用。)

In the JavaScript Console, print() will send the parameter to the printer.

(在JavaScript控制台中, print()会将参数发送到打印机。)

  ask by Tamas Czinege translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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控制台”。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...