通行证: 密码: 保存密码
收藏 帮助

IE中使用firebug


2008-10-11 天气:晴天 心情:微笑
原文地址:
http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/
在IE新建一个链接,属性如下:(去掉换行回车及空格)
在要调试的页面点链接即可
Javascript代码
  1.   
  2. javascript:   
  3. var h=document.getElementsByTagName('html');   
  4. h[0].setAttribute('debug''true');   
  5. if (!document.getElementById('_fb')) {    
  6.     var q=document.createElement('script');   
  7.     q.setAttribute('id''_fb');   
  8.     q.setAttribute('src''http://remysharp.com/wp-content/uploads/2007/03/firebug.js');   
  9.     document.getElementsByTagName('body')[0].appendChild(q);   
  10.     void(q);   
  11. }else{   
  12.     void(window.console.open());   
  13. }  

d:/zh/Files/Ajax/ieFirebug/firebug.js
firebug.js文件内容
Javascript代码
  1. if (!("console" in window) || !("firebug" in console)) {   
  2. (function()   
  3. {   
  4.     window.console =    
  5.     {   
  6.         log: function()   
  7.         {   
  8.             logFormatted(arguments, "");   
  9.         },   
  10.            
  11.         debug: function()   
  12.         {   
  13.             logFormatted(arguments, "debug");   
  14.         },   
  15.            
  16.         info: function()   
  17.         {   
  18.             logFormatted(arguments, "info");   
  19.         },   
  20.            
  21.         warn: function()   
  22.         {   
  23.             logFormatted(arguments, "warning");   
  24.         },   
  25.            
  26.         error: function()   
  27.         {   
  28.             logFormatted(arguments, "error");   
  29.         },   
  30.            
  31.         assert: function(truth, message)   
  32.         {   
  33.             if (!truth)   
  34.             {   
  35.                 var args = [];   
  36.                 for (var i = 1; i < arguments.length; ++i)   
  37.                     args.push(arguments[i]);   
  38.                    
  39.                 logFormatted(args.length ? args : ["Assertion Failure"], "error");   
  40.                 throw message ? message : "Assertion Failure";   
  41.             }   
  42.         },   
  43.            
  44.         dir: function(object)   
  45.         {   
  46.             var html = [];   
  47.                            
  48.             var pairs = [];   
  49.             for (var name in object)   
  50.             {   
  51.                 try  
  52.                 {   
  53.                     pairs.push([name, object[name]]);   
  54.                 }   
  55.                 catch (exc)   
  56.                 {   
  57.                 }   
  58.             }   
  59.                
  60.             pairs.sort(function(a, b) { return a[0] < b[0] ? -1 : 1; });   
  61.                
  62.             html.push('<table>');   
  63.             for (var i = 0; i < pairs.length; ++i)   
  64.             {   
  65.                 var name = pairs[i][0], value = pairs[i][1];   
  66.                    
  67.                 html.push('<tr>',    
  68.                 '<td class="propertyNameCell"><span class="propertyName">',   
  69.                     escapeHTML(name), '</span></td>''<td><span class="propertyValue">');   
  70.                 appendObject(value, html);   
  71.                 html.push('</span></td></tr>');   
  72.             }   
  73.             html.push('</table>');   
  74.                
  75.             logRow(html, "dir");   
  76.         },   
  77.            
  78.         dirxml: function(node)   
  79.         {   
  80.             var html = [];   
  81.                
  82.             appendNode(node, html);   
  83.             logRow(html, "dirxml");   
  84.         },   
  85.            
  86.         group: function()   
  87.         {   
  88.             logRow(arguments, "group", pushGroup);   
  89.         },   
  90.            
  91.         groupEnd: function()   
  92.         {   
  93.             logRow(arguments, "", popGroup);   
  94.         },   
  95.            
  96.         time: function(name)   
  97.         {   
  98.             timeMap[name] = (new Date()).getTime();   
  99.         },   
  100.            
  101.         timeEnd: function(name)   
  102.         {   
  103.             if (name in timeMap)   
  104.             {   
  105.                 var delta = (new Date()).getTime() - timeMap[name];   
  106.                 logFormatted([name+ ":", delta+"ms"]);   
  107.                 delete timeMap[name];   
  108.             }   
  109.         },   
  110.            
  111.         count: function()   
  112.         {   
  113.             this.warn(["count() not supported."]);   
  114.         },   
  115.            
  116.         trace: function()   
  117.         {   
  118.             this.warn(["trace() not supported."]);   
  119.         },   
  120.            
  121.         profile: function()   
  122.         {   
  123.             this.warn(["profile() not supported."]);   
  124.         },   
  125.            
  126.         profileEnd: function()   
  127.         {   
  128.         },   
  129.            
  130.         clear: function()   
  131.         {   
  132.             consoleBody.innerHTML = "";   
  133.         },   
  134.   
  135.         open: function()   
  136.         {   
  137.             toggleConsole(true);   
  138.         },   
  139.            
  140.         close: function()   
  141.         {   
  142.             if (frameVisible)   
  143.                 toggleConsole();   
  144.         },   
  145.   
  146.         evaled_lines: [],   
  147.         evaled_lines_pointer: 0    
  148.     };   
  149.     
  150.     // ********************************************************************************************   
  151.           
  152.     var consoleFrame = null;   
  153.     var consoleBody = null;   
  154.     var commandLine = null;   
  155.        
  156.     var frameVisible = false;   
  157.     var messageQueue = [];   
  158.     var groupStack = [];   
  159.     var timeMap = {};   
  160.        
  161.     var clPrefix = ">>> ";   
  162.        
  163.     var isFirefox = navigator.userAgent.indexOf("Firefox") != -1;   
  164.     var isIE = navigator.userAgent.indexOf("MSIE") != -1;   
  165.     var isOpera = navigator.userAgent.indexOf("Opera") != -1;   
  166.     var isSafari = navigator.userAgent.indexOf("AppleWebKit") != -1;   
  167.   
  168.     // ********************************************************************************************   
  169.   
  170.     function toggleConsole(forceOpen)   
  171.     {   
  172.         frameVisible = forceOpen || !frameVisible;   
  173.         if (consoleFrame)   
  174.             consoleFrame.style.visibility = frameVisible ? "visible" : "hidden";   
  175.         else  
  176.             waitForBody();   
  177.     }   
  178.   
  179.     function focusCommandLine()   
  180.     {   
  181.         toggleConsole(true);   
  182.         if (commandLine)   
  183.             commandLine.focus();   
  184.     }   
  185.   
  186.     function waitForBody()   
  187.     {   
  188.         if (document.body)   
  189.             createFrame();   
  190.         else  
  191.             setTimeout(waitForBody, 200);   
  192.     }       
  193.   
  194.     function createFrame()   
  195.     {   
  196.         if (consoleFrame)   
  197.             return;   
  198.            
  199.         window.onFirebugReady = function(doc)   
  200.         {   
  201.             window.onFirebugReady = null;   
  202.   
  203.             var toolbar = doc.getElementById("toolbar");   
  204.             toolbar.onmousedown = onSplitterMouseDown;   
  205.   
  206.             commandLine = doc.getElementById("commandLine");   
  207.             addEvent(commandLine, "keydown", onCommandLineKeyDown);   
  208.   
  209.             addEvent(doc, isIE || isSafari ? "keydown" : "keypress", onKeyDown);   
  210.                
  211.             consoleBody = doc.getElementById("log");   
  212.             layout();   
  213.             flush();   
  214.         }   
  215.   
  216.         var baseURL = getFirebugURL();   
  217.   
  218.         consoleFrame = document.createElement("iframe");   
  219.         // consoleFrame.setAttribute("src", baseURL+"/firebug.html");   
  220.         consoleFrame.setAttribute("frameBorder""0");   
  221.         consoleFrame.style.visibility = (frameVisible ? "visible" : "hidden");       
  222.         //consoleFrame.style.zIndex = "2147483647";   
  223.         consoleFrame.style.zIndex = "999999";   
  224.         consoleFrame.style.position = "fixed";   
  225.         consoleFrame.style.width = "100%";   
  226.         consoleFrame.style.left = "0";   
  227.         consoleFrame.style.bottom = "0";   
  228.         consoleFrame.style.height = "200px";   
  229.         document.body.appendChild(consoleFrame);   
  230.         consoleFrame.contentWindow.document.write(getFirebugConsoleiFrame());   
  231.     consoleFrame.contentWindow.document.close();   
  232.     }   
  233.        
  234.     // RS upgrade   
  235.     function getFirebugConsoleiFrame()    
  236.     {   
  237.         var html = '&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;&lt;head&gt;&lt;title&gt;Firebug&lt;/title&gt;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://getfirebug.com/firebug/firebug.css&quot;&gt;&lt;/head&gt;&lt;body&gt;&lt;div id=&quot;toolbar&quot; class=&quot;toolbar&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;parent.console.clear()&quot;&gt;Clear&lt;/a&gt;&lt;span class=&quot;toolbarRight&quot;&gt;&lt;a href=&quot;#&quot; onclick=&quot;parent.console.close()&quot;&gt;Close&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;&lt;input type=&quot;text&quot; id=&quot;commandLine&quot;&gt;&lt;script&gt;parent.onFirebugReady(document);&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;';   
  238.         return html.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"');   
  239.     }   
  240.        
  241.     function getFirebugURL()   
  242.     {   
  243.         var scripts = document.getElementsByTagName("script");   
  244.         for (var i = 0; i < scripts.length; ++i)   
  245.         {   
  246.             if (scripts[i].src.indexOf("firebug.js") != -1)   
  247.             {   
  248.                 var lastSlash = scripts[i].src.lastIndexOf("/");   
  249.                 return scripts[i].src.substr(0, lastSlash);   
  250.             }   
  251.         }   
  252.     }   
  253.        
  254.     function evalCommandLine()   
  255.     {   
  256.         var text = commandLine.value;   
  257.         commandLine.value = "";   
  258.   
  259.         console.evaled_lines[console.evaled_lines.length] = text;   
  260.         console.evaled_lines_pointer = console.evaled_lines.length;   
  261.   
  262.         logRow([clPrefix, text], "command");   
  263.            
  264.         var value;   
  265.         try  
  266.         {   
  267.             value = eval(text);   
  268.         }   
  269.         catch (exc)   
  270.         {   
  271.         }   
  272.   
  273.         console.log(value);   
  274.     }   
  275.        
  276.     function layout()   
  277.     {   
  278.         var toolbar = consoleBody.ownerDocument.getElementById("toolbar");   
  279.         var height = consoleFrame.offsetHeight - (toolbar.offsetHeight + commandLine.offsetHeight);   
  280.         consoleBody.style.top = toolbar.offsetHeight + "px";   
  281.         consoleBody.style.height = height + "px";   
  282.            
  283.         commandLine.style.top = (consoleFrame.offsetHeight - commandLine.offsetHeight) + "px";   
  284.     }   
  285.        
  286.     function logRow(message, className, handler)   
  287.     {   
  288.         if (consoleBody)   
  289.             writeMessage(message, className, handler);   
  290.         else  
  291.         {   
  292.             messageQueue.push([message, className, handler]);   
  293.             waitForBody();   
  294.         }   
  295.     }   
  296.        
  297.     function flush()   
  298.     {   
  299.         var queue = messageQueue;   
  300.         messageQueue = [];   
  301.            
  302.         for (var i = 0; i < queue.length; ++i)   
  303.             writeMessage(queue[i][0], queue[i][1], queue[i][2]);   
  304.     }   
  305.   
  306.     function writeMessage(message, className, handler)   
  307.     {   
  308.         var isScrolledToBottom =   
  309.             consoleBody.scrollTop + consoleBody.offsetHeight >= consoleBody.scrollHeight;   
  310.   
  311.         if (!handler)   
  312.             handler = writeRow;   
  313.            
  314.         handler(message, className);   
  315.            
  316.         if (isScrolledToBottom)   
  317.             consoleBody.scrollTop = consoleBody.scrollHeight - consoleBody.offsetHeight;   
  318.     }   
  319.        
  320.     function appendRow(row)   
  321.     {   
  322.         var container = groupStack.length ? groupStack[groupStack.length-1] : consoleBody;   
  323.         container.appendChild(row);   
  324.     }   
  325.   
  326.     function writeRow(message, className)   
  327.     {   
  328.         var row = consoleBody.ownerDocument.createElement("div");   
  329.         row.className = "logRow" + (className ? " logRow-"+className : "");   
  330.         row.innerHTML = message.join("");   
  331.         appendRow(row);   
  332.     }   
  333.   
  334.     function pushGroup(message, className)   
  335.     {   
  336.         logFormatted(message, className);   
  337.   
  338.         var groupRow = consoleBody.ownerDocument.createElement("div");   
  339.         groupRow.className = "logGroup";   
  340.         var groupRowBox = consoleBody.ownerDocument.createElement("div");   
  341.         groupRowBox.className = "logGroupBox";   
  342.         groupRow.appendChild(groupRowBox);   
  343.         appendRow(groupRowBox);   
  344.         groupStack.push(groupRowBox);   
  345.     }   
  346.   
  347.     function popGroup()   
  348.     {   
  349.         groupStack.pop();   
  350.     }   
  351.        
  352.     // ********************************************************************************************   
  353.   
  354.     function logFormatted(objects, className)   
  355.     {   
  356.         var html = [];   
  357.   
  358.         var format = objects[0];   
  359.         var objIndex = 0;   
  360.   
  361.         if (typeof(format) != "string")   
  362.         {   
  363.             format = "";   
  364.             objIndex = -1;   
  365.         }   
  366.   
  367.         var parts = parseFormat(format);   
  368.         for (var i = 0; i < parts.length; ++i)   
  369.         {   
  370.             var part = parts[i];   
  371.             if (part && typeof(part) == "object")   
  372.             {   
  373.                 var object = objects[++objIndex];   
  374.                 part.appender(object, html);   
  375.             }   
  376.             else  
  377.                 appendText(part, html);   
  378.         }   
  379.   
  380.         for (var i = objIndex+1; i < objects.length; ++i)   
  381.         {   
  382.             appendText(" ", html);   
  383.                
  384.             var object = objects[i];   
  385.             if (typeof(object) == "string")   
  386.                 appendText(object, html);   
  387.             else  
  388.                 appendObject(object, html);   
  389.         }   
  390.            
  391.         logRow(html, className);   
  392.     }   
  393.   
  394.     function parseFormat(format)   
  395.     {   
  396.         var parts = [];   
  397.   
  398.         var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/;       
  399.         var appenderMap = {s: appendText, d: appendInteger, i: appendInteger, f: appendFloat};   
  400.   
  401.         for (var m = reg.exec(format); m; m = reg.exec(format))   
  402.         {   
  403.             var type = m[8] ? m[8] : m[5];   
  404.             var appender = type in appenderMap ? appenderMap[type] : appendObject;   
  405.             var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0);   
  406.   
  407.             parts.push(format.substr(0, m[0][0] == "%" ? m.index : m.index+1));   
  408.             parts.push({appender: appender, precision: precision});   
  409.   
  410.             format = format.substr(m.index+m[0].length);   
  411.         }   
  412.   
  413.         parts.push(format);   
  414.   
  415.         return parts;   
  416.     }   
  417.   
  418.     function escapeHTML(value)   
  419.     {   
  420.         function replaceChars(ch)   
  421.         {   
  422.             switch (ch)   
  423.             {   
  424.                 case "<":   
  425.                     return "&lt;";   
  426.                 case ">":   
  427.                     return "&gt;";   
  428.                 case "&":   
  429.                     return "&amp;";   
  430.                 case "'":   
  431.                     return "&#39;";   
  432.                 case '"':   
  433.                     return "&quot;";   
  434.             }   
  435.             return "?";   
  436.         };   
  437.         return String(value).replace(/[<>&"']/g, replaceChars);   
  438.     }   
  439.   
  440.     function objectToString(object)   
  441.     {   
  442.         try  
  443.         {   
  444.             return object+"";   
  445.         }   
  446.         catch (exc)   
  447.         {   
  448.             return null;   
  449.         }   
  450.     }   
  451.   
  452.     // ********************************************************************************************   
  453.   
  454.     function appendText(object, html)   
  455.     {   
  456.         html.push(escapeHTML(objectToString(object)));   
  457.     }   
  458.   
  459.     function appendNull(object, html)   
  460.     {   
  461.         html.push('<span class="objectBox-null">', escapeHTML(objectToString(object)), '</span>');   
  462.     }   
  463.   
  464.     function appendString(object, html)   
  465.     {   
  466.         html.push('<span class="objectBox-string">&quot;', escapeHTML(objectToString(object)),   
  467.             '&quot;</span>');   
  468.     }   
  469.   
  470.     function appendInteger(object, html)   
  471.     {   
  472.         html.push('<span class="objectBox-number">', escapeHTML(objectToString(object)), '</span>');   
  473.     }   
  474.   
  475.     function appendFloat(object, html)   
  476.     {   
  477.         html.push('<span class="objectBox-number">', escapeHTML(objectToString(object)), '</span>');   
  478.     }   
  479.   
  480.     function appendFunction(object, html)   
  481.     {   
  482.         var reName = /function ?(.*?)\(/;   
  483.         var m = reName.exec(objectToString(object));   
  484.         var name = m ? m[1] : "function";   
  485.         html.push('<span class="objectBox-function">', escapeHTML(name), '()</span>');   
  486.     }   
  487.        
  488.     function appendObject(object, html)   
  489.     {   
  490.         try  
  491.         {   
  492.             if (object == undefined)   
  493.                 appendNull("undefined", html);   
  494.             else if (object == null)   
  495.                 appendNull("null", html);   
  496.             else if (typeof object == "string")   
  497.                 appendString(object, html);   
  498.             else if (typeof object == "number")   
  499.                 appendInteger(object, html);   
  500.             else if (typeof object == "function")   
  501.                 appendFunction(object, html);   
  502.             else if (object.nodeType == 1)   
  503.                 appendSelector(object, html);   
  504.             else if (typeof object == "object")   
  505.                 appendObjectFormatted(object, html);   
  506.             else  
  507.                 appendText(object, html);   
  508.         }   
  509.         catch (exc)   
  510.         {   
  511.         }   
  512.     }   
  513.            
  514.     function appendObjectFormatted(object, html)   
  515.     {   
  516.         var text = objectToString(object);   
  517.         var reObject = /\[object (.*?)\]/;   
  518.   
  519.         var m = reObject.exec(text);   
  520.         html.push('<span class="objectBox-object">', m ? m[1] : text, '</span>')   
  521.     }   
  522.        
  523.     function appendSelector(object, html)   
  524.     {   
  525.         html.push('<span class="objectBox-selector">');   
  526.   
  527.         html.push('<span class="selectorTag">', escapeHTML(object.nodeName.toLowerCase()), '</span>');   
  528.         if (object.id)   
  529.             html.push('<span class="selectorId">#', escapeHTML(object.id), '</span>');   
  530.         if (object.className)   
  531.             html.push('<span class="selectorClass">.', escapeHTML(object.className), '</span>');   
  532.   
  533.         html.push('</span>');   
  534.     }   
  535.   
  536.     function appendNode(node, html)   
  537.     {   
  538.         if (node.nodeType == 1)   
  539.         {   
  540.             html.push(   
  541.                 '<div class="objectBox-element">',   
  542.                     '&lt;<span class="nodeTag">', node.nodeName.toLowerCase(), '</span>');   
  543.   
  544.             for (var i = 0; i < node.attributes.length; ++i)   
  545.             {   
  546.                 var attr = node.attributes[i];   
  547.                 if (!attr.specified)   
  548.                     continue;   
  549.                    
  550.                 html.push('&nbsp;<span class="nodeName">', attr.nodeName.toLowerCase(),   
  551.                     '</span>=&quot;<span class="nodeValue">', escapeHTML(attr.nodeValue),   
  552.                     '</span>&quot;')   
  553.             }   
  554.   
  555.             if (node.firstChild)   
  556.             {   
  557.                 html.push('&gt;</div><div class="nodeChildren">');   
  558.   
  559.                 for (var child = node.firstChild; child; child = child.nextSibling)   
  560.                     appendNode(child, html);   
  561.                        
  562.                 html.push('</div><div class="objectBox-element">&lt;/<span class="nodeTag">',    
  563.                     node.nodeName.toLowerCase(), '&gt;</span></div>');   
  564.             }   
  565.             else  
  566.                 html.push('/&gt;</div>');   
  567.         }   
  568.         else if (node.nodeType == 3)   
  569.         {   
  570.             html.push('<div class="nodeText">', escapeHTML(node.nodeValue),   
  571.                 '</div>');   
  572.         }   
  573.     }   
  574.   
  575.     // ********************************************************************************************   
  576.        
  577.     function addEvent(object, name, handler)   
  578.     {   
  579.         if (document.all)   
  580.             object.attachEvent("on"+name, handler);   
  581.         else  
  582.             object.addEventListener(name, handler, false);   
  583.     }   
  584.        
  585.     function removeEvent(object, name, handler)   
  586.     {   
  587.         if (document.all)   
  588.             object.detachEvent("on"+name, handler);   
  589.         else  
  590.             object.removeEventListener(name, handler, false);   
  591.     }   
  592.        
  593.     function cancelEvent(event)   
  594.     {   
  595.         if (document.all)   
  596.             event.cancelBubble = true;   
  597.         else  
  598.             event.stopPropagation();           
  599.     }   
  600.   
  601.     function onError(msg, href, lineNo)   
  602.     {   
  603.         var html = [];   
  604.            
  605.         var lastSlash = href.lastIndexOf("/");   
  606.         var fileName = lastSlash == -1 ? href : href.substr(lastSlash+1);   
  607.            
  608.         html.push(   
  609.             '<span class="errorMessage">', msg, '</span>',    
  610.             '<div class="objectBox-sourceLink">', fileName, ' (line ', lineNo, ')</div>'  
  611.         );   
  612.            
  613.         logRow(html, "error");   
  614.     };   
  615.   
  616.     function onKeyDown(event)   
  617.     {   
  618.         if (event.keyCode == 123)   
  619.             toggleConsole();   
  620.         else if ((event.keyCode == 108 || event.keyCode == 76) && event.shiftKey   
  621.                  && (event.metaKey || event.ctrlKey))   
  622.             focusCommandLine();   
  623.         else if (event.keyCode == 38) {   
  624.             if (console.evaled_lines_pointer > 0) {   
  625.                  console.evaled_lines_pointer--;   
  626.                  commandLine.value = console.evaled_lines[console.evaled_lines_pointer];   
  627.             }   
  628.         } else if (event.keyCode == 40) {   
  629.             if (console.evaled_lines_pointer < console.evaled_lines.length - 1) {   
  630.                  console.evaled_lines_pointer++;   
  631.                  commandLine.value = console.evaled_lines[console.evaled_lines_pointer];   
  632.             }   
  633.         } else  
  634.             return;   
  635.            
  636.         cancelEvent(event);   
  637.     }   
  638.   
  639.     function onSplitterMouseDown(event)   
  640.     {   
  641.         if (isSafari || isOpera)   
  642.             return;   
  643.            
  644.         addEvent(document, "mousemove", onSplitterMouseMove);   
  645.         addEvent(document, "mouseup", onSplitterMouseUp);   
  646.   
  647.         for (var i = 0; i < frames.length; ++i)   
  648.         {   
  649.             addEvent(frames[i].document, "mousemove", onSplitterMouseMove);   
  650.             addEvent(frames[i].document, "mouseup", onSplitterMouseUp);   
  651.         }   
  652.     }   
  653.        
  654.     function onSplitterMouseMove(event)   
  655.     {   
  656.         var win = document.all   
  657.             ? event.srcElement.ownerDocument.parentWindow   
  658.             : event.target.ownerDocument.defaultView;   
  659.   
  660.         var clientY = event.clientY;   
  661.         if (win != win.parent)   
  662.             clientY += win.frameElement ? win.frameElement.offsetTop : 0;   
  663.            
  664.         var height = consoleFrame.offsetTop + consoleFrame.clientHeight;   
  665.         var y = height - clientY;   
  666.            
  667.         consoleFrame.style.height = y + "px";   
  668.         layout();   
  669.     }   
  670.        
  671.     function onSplitterMouseUp(event)   
  672.     {   
  673.         removeEvent(document, "mousemove", onSplitterMouseMove);   
  674.         removeEvent(document, "mouseup", onSplitterMouseUp);   
  675.   
  676.         for (var i = 0; i < frames.length; ++i)   
  677.         {   
  678.             removeEvent(frames[i].document, "mousemove", onSplitterMouseMove);   
  679.             removeEvent(frames[i].document, "mouseup", onSplitterMouseUp);   
  680.         }   
  681.     }   
  682.        
  683.     function onCommandLineKeyDown(event)   
  684.     {   
  685.         if (event.keyCode == 13)   
  686.             evalCommandLine();   
  687.         else if (event.keyCode == 27)   
  688.             commandLine.value = "";   
  689.     }   
  690.        
  691.     window.onerror = onError;   
  692.     addEvent(document, isIE || isSafari ? "keydown" : "keypress", onKeyDown);   
  693.        
  694.     if (document.documentElement.getAttribute("debug") == "true")   
  695.         toggleConsole(true);   
  696. })();   
  697. }  

原文地址:
http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/

推荐到博客首页 (0) |  复制链接 |  评论: 0 |  阅读: 2460 |  个人分类: 日记 |  系统分类: 未分类 |  发表于: 2008.10.11 00:00

评论


表情 超链接
操作中,请等待...