Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Window.console

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

The Window.console read-only property returns a reference to the Console object, which provides methods for logging information to the browser's console. These methods are intended for debugging purposes only and should not be relied on for presenting information to end users.

Syntax

var consoleObj = window.console;

Examples

Logging to console

The first example logs text to the console.

console.log("An error occurred while loading the content");

The next example logs an object to the console, with the object's fields expandable using disclosure widgets:

console.dir(someObject);

See "Usage" in Console for more thorough examples.

Specifications

Specification Status Comment
Console API Living Standard Initial definition.

Currently there are many implementation differences among browsers, but work is being done to bring them together and make them more consistent with one another.

ドキュメントのタグと貢献者

 このページの貢献者: Sheppy
 最終更新者: Sheppy,