firebug 控制_将信息记录到Firebug JavaScript控制台

firebug 控制

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-将您自己的消息发送到控制台!

翻译自: https://davidwalsh.name/firebug-console-log

firebug 控制

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值