zoukankan      html  css  js  c++  java
  • Firebug 调试技巧之console API

    console.log(object[, object, ...])

    Writes a message to the console. You may pass as many arguments as you'd like, and they will be joined together in a space-delimited line.

    console.debug(object[, object, ...])

    Writes a message to the console, including a hyperlink to the line where it was called.

    console.info(object[, object, ...])

    Writes a message to the console with the visual "info" icon and color coding and a hyperlink to the line where it was called.

    console.warn(object[, object, ...])

    Writes a message to the console with the visual "warning" icon and color coding and a hyperlink to the line where it was called.

    console.error(object[, object, ...])

    Writes a message to the console with the visual "error" icon and color coding and a hyperlink to the line where it was called.

    console.assert(expression[, object, ...])

    Tests that an expression is true. If not, it will write a message to the console and throw an exception.

    console.clear()

    Clears the console.

    console.dir(object)

    Prints an interactive listing of all properties of the object. This looks identical to the view that you would see in the DOM Panel.

    console.dirxml(node)

    Prints the XML source tree of an HTML or XML element. This looks identical to the view that you would see in the HTML Panel. You can click on any node to inspect it in the HTML Panel.

    console.trace()

    Prints an interactive stack trace of JavaScript execution at the point where it is called.

    The stack trace details the functions on the stack, as well as the values that were passed as arguments to each function. You can click each function to take you to its source in the Script tab, and click each argument value to inspect it in the DOM or HTML Panel.

    console.group(object[, object, ...])

    Writes a message to the console and opens a nested block to indent all future messages sent to the console. Call console.groupEnd() to close the block.

    console.groupCollapsed(object[, object, ...])

    Like console.group(), but the block is initially collapsed.

    console.groupEnd()

    Closes the most recently opened block created by a call to console.group() or console.groupCollapsed()

    console.time(name)

    Creates a new timer under the given name. Call console.timeEnd() with the same name to stop the timer and print the time elapsed.

    console.timeEnd(name)

    Stops a timer created by a call to console.time(name) and writes the time elapsed.

    console.timeStamp(name)

    Creates a time stamp, which can be used together with HTTP traffic timing to measure when a certain piece of code was executed.

    console.profile([title])

    Turns on the JavaScript profiler.

    console.profileEnd()

    Turns off the JavaScript profiler and prints its report.

    console.count([title])

    Writes the number of times that the line of code where count was called was executed.

    console.exception(error-object[, object, ...])

    Prints an error message together with an interactive stack trace of JavaScript execution at the point where the exception occurred.

    console.table(data[, columns])

    Allows to log provided data using tabular layout. 

  • 相关阅读:
    JavaScript中常见的十五种设计模式
    如何使 highchart图表标题文字可选择复制
    python如何以表格形式打印输出
    记一次vue长列表的内存性能分析和优化
    如何收集常见的前端性能信息
    如何实现同等间隙的卡片布局
    图片横向等高瀑布流,每行占满,限制行数 的实现
    弹窗查看内容时 内容滚动区域设置为body区
    卡片列表项缓缓往下展示 效果实现
    【年终总结】微信前端社招有感
  • 原文地址:https://www.cnblogs.com/lxthyme/p/5076428.html
Copyright © 2011-2022 走看看