Firebug : console is not defined

来自http://tunps.com/firebug-console-is-not-defined

今天在公司没事干,公司产品的代码读了个大概50%。

打算将这个系统的人员组织结构树用jquery.treeview这个插件来实现,所以正在熟悉这个插件。

调试调用这个插件:

$(document).ready(function(){
    $("#browser").treeview({
        toggle: function() {
            console.log("%s was toggled.", $(this).find(">span").text());
        }
    });

 

F5刷新,点任意树状节点,Web Developer扩展里面出现一个javascript错误:

console is not defined

google了一下发现console是firebug提供了一个用于js调试的对象,除了log,还提供了很多其他的方法。

难怪Web Developer无法识别console是嘛东东。

直接打开firebug查看调试信息,Web Developer的错误信息可以不用理会,firebug太tmd强大了。

firebug console output

About tunpishuang

just 4 fun·····
This entry was posted in 未分类. Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>