For a long time, due to the lack of a standardized debugging environment and a powerful development platform. In terms of HTML, CSS, JavaScript, and other technologies, people need to invest a lot of time and energy to perform boring tests. However, the emergence of Firebug greatly saves the development time of Web developers. In particular, its JavaScript Console makes HTML pages active in developers' hands.
The console is the most commonly used. log, lele.info, and console. error: these methods are useful, whether directly outputting JavaScript running results or implementing the connection between the WordPress and JavaScript in HTML. You only need a simple console. log (someVariable); or a line of com. flash. external. externalInterface. call ("console. log ", someVariable); then you can see the result of the variable (expression.
However, the Console actually provides many powerful API interfaces. Many friends do not seem to know yet. I will share with you a few of what I know.
Console. dir (anyObject )-Structure of the directly output object, Example
Console. dirxml (anyDOMNode )-Similar to the preceding example, the HTML node content is output in indent format,
Console. time (slugName)-console. timeEnd (slugName )-Records the execution time of a timestamp and can be used to optimize loop statements,
Console. group ()-console. groupEnd ()-Group output content, see the figure to understand:
From: http://xinsync.xju.edu.cn/index.php/archives/3724