javascript調試工具:Blackbird !say “hello” to Blackbird and “goodbye” to alert().

來源:互聯網
上載者:User

    平時調試JS的時候,需要大量使用alert語句,不僅效率不高,而且老彈確認視窗,讓人覺得不悅。今天在網上找文章看的時候發現了一個很酷的javascript:Blackbird ,去了他的官方轉轉,看看這個口號是與alert說再見的js有什麼特別之處。

     這是Blackbird 的介面,夠黑的,呵呵。用過firebug調試JS的朋友這個介面應該很熟悉了,現在大家知道Blackbird 的主要用途了,它就是方便JS作者輸出調試資訊的,看來真的可以給alert說再見了。    Blackbird js架構中只有4個檔案:blackbird_icons.png,blackbird_panel.png,blackbird.js,blackbird.css。我們只需要在頁面中引入他的JS和CSS,就可以使用它方便的輸出功能了。
<html><head><script type="text/javascript" src="/PATH/TO/blackbird.js"></script><link type="text/css" rel="Stylesheet" href="/PATH/TO/blackbird.css" />...</head>...
     如需要輸出中的資訊,js代碼是這樣的:     log.debug( 'this is a debug message' );
     log.info( 'this is an info message' );
     log.warn( 'this is a warning message' );
     log.error( 'this is an error message' );     是不是很便利,呵呵。 看看Blackbird 的API(摘抄的):     log.toggle()          顯示或隱藏 Blackbird
     log.move()            移動
     log.resize()           修改 Blackbird 視窗顯示大小
     log.clear()             清空資訊
     log.debug( message )   debug 資訊
     log.info( message )     一般訊息
     log.warn( message )      警告資訊
     log.error( message )    錯誤資訊
     log.profile( label )     計算消耗時間 是Blackbird 控制台的快速鍵:官方地址:http://www.gscottolson.com/blackbirdjs/ 
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.