jQuery到Firebug日志
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery到Firebug日志相关的知识,希望对你有一定的参考价值。
A simple but powerful interface for allowing firebug access functions in the jQuery chain.See the link above to check out the functions it accepts.
$.enableConsole = false; $.fn.console = $.console = function(method){ if (window.console && console[method] && $.enableConsole) console[method].apply(this, [].splice.call(arguments,1)) return this; } // When debugging code, be sure to set: $.enableConsole = true; // Or none of your lines will reach the console // You can call any firebug functions through either the direct jQuery object, or in a chain: $.console('debug', 'This is some %s text', 'debugging'); // The best part is the ability to use the firebug console chain easily: var color = '#FFF'; $('#someElement').css('backgroundColor', color).console('log', 'Changing the background color to "%s"', color); // And the access to the other functions of the firebug console, like time/timeEnd $('#someElement').console('time', 'timing foo').animate({...}).console('timeEnd', 'timing foo');
以上是关于jQuery到Firebug日志的主要内容,如果未能解决你的问题,请参考以下文章
在 firebug 中发现 JQuery 语法错误,但在我的代码中没有