firebug 控制
![](https://i-blog.csdnimg.cn/blog_migrate/d5fe604b33d147dfcfe0717c64a31efc.png)
Firebug is the ultimate Web Developer debugging tool. Firebug gives you control over the page's XHTML, JavaScript, CSS, AJAX requests, and more. It's important not to simply take in what Firebug tells you though -- you can log information to your Firebug console from within your page's JavaScript. Here are a few of the helpful methods you can use:
Firebug是终极的Web Developer调试工具。 Firebug使您可以控制页面的XHTML,JavaScript,CSS,AJAX请求等。 重要的是不要简单地接受Firebug告诉您的内容-您可以从页面JavaScript中将信息记录到Firebug控制台中。 以下是一些可以使用的有用方法:
console.log() (console.log())
console.log('Application is starting.');
The console.log() method logs a message to the console without providing a line number. Simple but useful.
console.log()方法将消息记录到控制台,但不提供行号。 简单但有用。
console.debug() (console.debug())
console.debug('Gets to this point without error.');
The console.debug() method logs a message to Firebug console just like log(), but debug() provides a line number reference.
console.debug()方法将消息记录到Firebug控制台,就像log()一样,但是debug()提供行号参考。
console.info() (console.info())
console.info('DOM is ready, now executing Moo event.');
The console.info() method logs a message to the Firebug console with a blue "information" icon. Line number reference is included.
console.info()方法将带有蓝色“信息”图标的消息记录到Firebug控制台。 包括行号参考。
console.warn() (console.warn())
console.warn('Form field [title] has no value.');
console.warn() sets a warning within the console. The warning provides a yellow background color to easily spot warnings within the console.
console.warn()在控制台内设置警告。 该警告提供了黄色的背景颜色,可轻松在控制台内发现警告。
console.error() (console.error())
console.error('The [title] element is undefined. Bad news.');
The console.error() method places a custom error message within the console with a pink background. Easy to spot.
console.error()方法将自定义错误消息放入带有粉红色背景的控制台中。 容易发现。
Each of the above methods accept an "object", or array of objects, and works much like a print-f.
上面的每种方法都接受一个“对象”或对象数组,其工作方式与print-f非常相似。
带物体 (With Objects)
console.log("The %d item has a value of: %d", fifth, myvalue);
This probably looks familiar to a PHP programmer.
PHP程序员可能对此很熟悉。
Make the most of your Firebug -- send your own message to the console!
充分利用您的Firebug-将您自己的消息发送到控制台!
firebug 控制