1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > [JavaScript] FireBug 调试

[JavaScript] FireBug 调试

时间:2024-01-26 12:47:54

相关推荐

[JavaScript] FireBug 调试

Firebug Script 调试记录

Your new friend, console.log //显示变量参数

console.log,console.debug,console.info,console.warn,console.error...

console.log("helloworld")

console.log(2,4,6,8,"foo",bar)

console.log("%a,%b","foo",bar)//"%"用于定义量

console.log("%sis%dyearsold.","Bob",42).

Timing and profiling // 时间及性能分析

console.profile();//性能开始

console.time("test");//时间开始

functionTest()

{

for(vari=0;i<10;i++)

{

console.info("thisisatest");

}

}

Test();

console.timeEnd("test");//时间结束

console.profileEnd();//性能结束

Stack traces

console.trace()

Nested grouping

Just callconsole.group("a title")to start a new indentation block, and thenconsole.groupEnd()to close the block. You can create as many levels of indentation as you please.

Object inspection//显示对象信息

Callingconsole.dir(object)will log an interactive listing of an object's properties, like a miniature version of the DOM tab.

Callingconsole.dirxml(element)on any HTML or XML element will print a lovely XML outline, like a miniature version of the HTML tab.

console.dir(document.getElementById("sleCategory"));

console.dirxml(document.getElementById("sleCategory"));

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。