`
johnson_gong
  • 浏览: 12503 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

firbug之console 小结

 
阅读更多

目的:整理Firbug工具的常用命令:console。以提高开发效率。

 

/*
 目的:了解常用console命令.
 ps: 
 1.就本人经验来看,经常用到的也就是:[console.log()];所以客观上没有充分发挥console的作用。
 2.现在整理一点笔记,以便在今后开发过程中 更有效率。
   [console.group,console.groupEnd;
   console.time,console.timeEnd;
   console.profile,console.profileEnd;]
 3. console.log("%c, "font-size:25px; ...")
 
 */

 

testConsole : function(){
        
        // http://getfirebug.com/logging
        
        /*
        console.log:记录一行信息,无任何图标提示;
        console.debug:记录一行信息,带超链接,可以链接到语句调用的地方;
        console.error():向控制台中写入错误信息,带错误图标显示和高亮代码链接;
        console.info():向控制台中写入提示信息,带信息图标显示和高亮代码链接;
        console.warn():向控制台中写入警告信息,带警告图标显示和高亮代码链接;
        */
        
        console.log("%c ----testConsole----", [ 'font-size:25px', 'line-height:28px', 'color: skyblue' ].join(';'));
        console.log("%c we can use css to set style of the [console.log]!", 
        "font-size:25px; color: green; background:yellow;");
        
        console.group("Group 1 [console.log]");
        console.log("This is console.log");
        console.warn("This is console.warn");
        console.error("This is console.error");
        // console.debug("This is console.debug");
        console.groupEnd();
        
        // Logging object hyperlinks
        // Elements, functions, arrays, plain ol' objects, you name it.
        console.group("Group 2 [Logging object hyperlinks].");
        var car ={
        name:"BMW", 
        COLOR:"YELLOW",
        aaa:"aaa",
        bbb:"bbbb",
        ccc:"ccc",
        ddd:"ddd",
        };
        
        var ary01 = [1,2,3,4,5,6,7,8];
        
        console.log(" Object >>", car);
        console.log("function >>", this.testMain);
        console.log("Array >>", ary01);
        console.groupEnd();
        
        // 1. String formatting
        console.group("Group 3 [Logging object hyperlinks].");
        console.log(" %s is %d years old.", "Bob", 42);
        console.groupEnd();
        
        // Stack traces, 这个函数可以打印出程序执行时从起点到终点的路径信息。
        console.group("Group 4 [Stack traces].");
        console.trace();
        console.groupEnd();
        
        // Object inspection
        console.group("Group 5 [Object inspection].");
        // console.dir(object) will log an interactive listing of an object's properties
        console.dir(car);
        // console.dirxml(element) on any HTML or XML element.
        console.dirxml(document.getElementById("lstDiv"));
        console.groupEnd();
        
        
        // Be assertive
        console.group("Group 6 [Be assertive].");
        console.assert(1);
        console.assert(0);
        console.assert((3 == 4));
        console.groupEnd();


    },

 运行效果图:



 

 

 

 

  • 大小: 82.3 KB
分享到:
评论

相关推荐

    firefox 最新版3.6 带firbug最新版

    firefox 最新版3.6 带firbug最新版firefox 最新版3.6 带firbug最新版firefox 最新版3.6 带firbug最新版firefox 最新版3.6 带firbug最新版firefox 最新版3.6 带firbug最新版firefox 最新版3.6 带firbug最新版firefox ...

    firfox 3.6.10 firbug1.7 firbug 1.9

    网页可发必备的工具。firbug1.7在firfox 3.6.10可以安装。firbug1.9不行。

    支持firbug最高版本的火狐浏览器

    支持firbug最高版本的火狐浏览器,版本为49.02,火狐版本超过50以后不firbug不支持

    firbug1.6 web调试好工具

    调试css js等,辅助网页设计的好帮手。

    ysllow + firbug + firefox资源下载

    ysllow + firbug + firefox资源下载

    IE页面调试工具,ie中的firbug

    IE页面调试工具,ie中的firbug,内含汉化包,个人收藏 很好用

    firebug-1.8.4.xpi

    firebug-1.8.4.xpi firebug-1.8.4.xpi firebug-1.8.4.xpi firebug-1.8.4.xpi

    HttpWatch.Professional.v5.2.16.rar

    类似firbug的工具 在ie使用firbug工具。

    firefox firebug

    firefox firbug JS WEB 调试

    IE6下调试工具-js写的高仿firebug

    IE6下调试工具-js写的高仿firebug

    Firefox 48.0.2渗透专版

    Firefox 48.0.2 渗透专版 含多个常用插件 firbug 、hackbar等等 解压密码---压缩包内解压密码.txt 。解压缩直接使用,设置内将自动更新禁止。

    firebug-1.4.5

    Firebug 是Web Developer绝对必要的省时利器,它已经成了前端网页开发者的必备工具。Firbug可以轻松的查看DOM,以了解其原理,以及可以在运行中调整CSS/HTML /Js

    Firebug使用教程

    Firbug插件要配合firefox浏览器来使用,开发web,不用firebug是在是太out了。 下去下载个firefox,在选中 工具 ,点击 附加组件 ,右上角有一个search框,输入 firebug 、、、、、 装好之后,参考本教程就OK了

    锋利的jQuery(第2版).单东林、张晓菲、魏然(带详细书签)

    前端开发调试工具Firbug 插件的API AJAX的核心对象XMLHttpRequest jQuery API速查表 jQuery中的$.ajax方法 《锋利的jQuery(第2版)》循序渐进地对jQuery的各种函数和方法调用进行了介绍,读者可以系统地掌握jQuery的...

    切换类和样式规则是一种代价非常高的操作

    Firbug可以轻松的查看DOM,以了解其原理,以及可以在运行中调整CSS/HTML /JS, 除此之外,也可以帮你调试和注释(profile)你的JavaScrpt代码,帮你弄起初究竟是什么状况导致了你的脚本运行中断。

    原生javaScript做得动态表格(注释写的很清楚)

    我们一般称为禽兽书(跟我一同学的名字很像大笑),然后一直想做一个列子来练练手,因为看公司好多用动态表格的,所以,我就试着用js做了动态表格,用firfox浏览器来调试的,因为firbug插件用着比较好,本来就是想...

    WordPress 模板制作过程中的错误定位方法

    在wordpress模板制作过程中,有一些貌似复杂的问题,其实只要确定了问题出现的位置...等搜索结果出来后点击Firbug链接进入Firebug的下载安装页面。 1.2 使用方法 安装完成后,在自己出错的位置上,点右键==>查看元素,

    使用排除法解决模板上的问题

    在wordpress模板制作过程中,有一些貌似复杂的问题,其实只要确定了问题出现的位置...等搜索结果出来后点击Firbug链接进入Firebug的下载安装页面。 1.2 使用方法 安装完成后,在自己出错的位置上,点右键==>查看元素,

    Jquery下:nth-child(an+b)的使用注意

    后面两个Class为空来应对可能增加的列数来调节列宽 $(“div>p”).parent().not($(“.grid_2”)).filter(“nth-child(“+lenth+”n+1)”)来选择每行的第2列,但是却选中了第三列,百思不得其解 利用firbug查询该元素...

Global site tag (gtag.js) - Google Analytics