摘要:
还在用alert简单粗暴的调试js,试试Chrome的console工具吧。打开Chrome按下F12,进入Console选项卡,进入console模式。1.使用断言调试工具console.assert()如:var num = 100;console.assert(num == 100);断言失败会报错。2.调试过多的信息,需要清除屏幕,使用console.clear()3.console.count()记录函数调用次数,对于调试递归函数很有用。如:var func = function (n) { console.count("func call"); if (n == 阅读全文
posted @ 2014-02-14 11:04
jaw-crusher
阅读(865)
评论(0)
推荐(0)

浙公网安备 33010602011771号