close

之前一直好像有聽過這個東西,可是一直沒試過,今天試了一下發現對 Debug 來說真是太好用了
詳細請參考:https://getfirebug.com/wiki/index.php/Console_API

用法:

<script>
/* 列印物件 */
var a = {id:1, name:"wbkuo", age:18};
console.log(a);

/* 可用 printf 的顯示方式 */
var b = "cool";
var c = "tool";
console.log("console.log is %s %s", b, c);

/* 計算開始與結束時間 */
console.time("test")
for (var i=0; i<1000000; i++) ;
console.timeEnd("test")
</script>



結果(在 firefox 的 firebug 中觀察):
console_log    

註:另外有個類似的工具 firephp 也很好用

arrow
arrow
    全站熱搜

    wbkuo 發表在 痞客邦 留言(0) 人氣()