firebug的應用,firebug應用

來源:互聯網
上載者:User

firebug的應用,firebug應用

firebug再前端調試中起到了很好的作用能看到DOM的效能,以及檢測,比如運用console.log()就是要比alert();好一些這樣增強頁面的連續性並且console.warn()和console.error也在瀏覽器中的控制台中報錯或者彈出警告,這樣也是很有用的,如果運用多個log是不容易看清的,這樣就可以這樣分組 //console.group("this is one");
    //console.log(1);
    //console.groupEnd();這樣分組的好處就是能看出需要調試的是哪一代碼;有的時候console.log不能完全顯示這樣就能吧log換位dir這樣就能完全顯示

雖然這個在Google和Firefox上是有用的,但是在IE上也是可以的只需要在有網的情況下加入<script type="text/javascript" src="https://getfirebug.com/firebug-lite.js"></script>這一樣代碼,在在IE也就可以用了

也可以先把資源下載下來https://getfirebug.com/firebuglite然後在檔案裡引用就可以了




<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>無標題</title>
    <script type="text/javascript">
    ///////////////////////
    //console.log(1285); //
    ///////////////////////
    //console.warn("this is a warn ");
    //console.group("this is one");
    //console.log(1);
    //console.groupEnd();

    //console.group("this is two");  //代表分組
    //console.log(2);
    //console.groupEnd();//分組結束
    //var cat={};
    //cat.color="red";
    //cat.name1="shang";
    //cat.name2="shang";
    //cat.name3="shang";
    //cat.name4="shang";
    //cat.name5="shang";
    //cat.show=function(){
    //    return "cat";
    //}
    //console.log(cat);
    //console.dir(cat);//這個相比於前面是全部顯示
    //var odiv1=document.getElementById('div1');
    //console.dirxml(odiv1); // 顯示當前元素的結構代碼
    //console.log(58);
    
    //var a=0;
    //console.assert(a);


    //function a(){
    //    return b();
    //}
    //function b(){
    //    return c();
    //}
    //function c(){
    //    console.trace();
    //    return 132;
    //}
//a();
    
    //console.time("時間");//這裡要寫一個標題也就是雙引號裡面的東西
    //for(var i=0;i<1000000000;i++){}
    //console.timeEnd("時間");//前後都需要有標題
//而且相同    //

    </script>
</head>
<body>
<div id="div1">
    <span>16746</span>>
</div>
</body>
</html>

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.