FireBug 調(diào)試JS入門 —如何調(diào)試JS
安裝就不用說(shuō)了,很簡(jiǎn)單,在FireFox上插件庫(kù)里找到FireBug就Ok了。下圖是FireBug Debug 窗口。

Firebug includes a powerful JavaScript debugger that lets you pause execution at any time and see what each variable looked like at that moment. If your code is a little sluggish, use the JavaScript profiler to measure performance and find bottlenecks fast.
簡(jiǎn)而言之,F(xiàn)ireBug 可以讓我們?cè)谌魏螘r(shí)候debugJS 并查看變量,同時(shí)可以通過(guò)它找出JS中性能瓶頸。
下圖是如何找到Web應(yīng)用的JS,激活Firebug,點(diǎn)Script,然后在All 旁邊選擇你要Debug的JS。

下圖是如何打斷點(diǎn) 基本跟Eclipse一樣,點(diǎn)擊行號(hào)就Ok了。





下圖是在斷點(diǎn)處查看變量。

有個(gè)很好用的功能,代碼行之間快速調(diào)轉(zhuǎn),使得對(duì)上千行的JS調(diào)試很輕松。


還有一個(gè)Log功能比較實(shí)用,看下圖 如果你不想每次都進(jìn)入斷點(diǎn),用這個(gè)就再好不過(guò)了。

posted on 2009-04-14 20:01 advincenting 閱讀(54067) 評(píng)論(19) 編輯 收藏 所屬分類: 腳本