您的位置:首页 > 其它

Firefox - 附加软件 - Firebug - Console控制台视图 - console对象输出时,需要注意第一个参数被自动识别为格式字符串

2007-10-14 20:04 736 查看

Firefox - 附加软件 - Firebug - Console控制台视图 - console对象输出时,需要注意第一个参数被自动识别为格式字符串

[Console API文档]

http://www.getfirebug.com/console.html
在Firebug中,console对象的log, debug, info, warn, error, assert, group在输出信息时,均把一个参数自动按照格式字符串识别,仅当不符合格式字符串的格式时,才输出,例如:


>>> console.info("s", document)

s Document


>>> console.info("%s", document)

[object HTMLDocument]


第二个例子中,%s符合格式字符串的要求,所以被自动识别为格式字符串。因此在容易出现混淆的地方,为了避免混淆,第一个参数可以使用"",例如:

>>> console.info("", "%s", document)
%s Document discuz

[Firefox - 附加软件]

CookieSafe, 当前版本2.0.6, 常用, https://addons.mozilla.org/en-US/firefox/addon/2497 Firebug, 当前版本1.05, 常用, https://addons.mozilla.org/en-US/firefox/addon/1843 Google Toolbar for Firefox, 当前版本3.0.20070525W, 常用, http://www.google.com/tools/firefox/toolbar/FT2/intl/zh-CN/ Html Validator, 当前版本0.8.4.0, 常用, https://addons.mozilla.org/firefox/249/ MinimizeToTray, 当前版本0.0.1.2006102615+, 不常用, https://addons.mozilla.org/firefox/2110/ Tab Mix Plus, 当前版本0.3.6, 不常用, https://addons.mozilla.org/firefox/1122/ Torbutton, 当前版本1.0.4.01, 常用, https://addons.mozilla.org/en-US/firefox/addon/2275

[Firebug - 简介]

当前版本:1.05
Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
在您浏览时集成在Firefox中的Firebug能让您对于大量开发工具了如指掌。您可以实时在任何浏览的页面中编辑、调试、监视CSS,HTML和JavaScript。
Visit the Firebug website for documentation, screen shots, and discussion forums:
访问Firebug站点可以获得文档、效果图和讨论论坛。

[Firebug - 发布网址]

https://addons.mozilla.org/en-US/firefox/addon/1843

[Firebug - 站点]

http://www.getfirebug.com

[Firebug - 文档]

http://www.getfirebug.com/docs.html

[Firebug - bug]

http://code.google.com/p/fbug/issues/list

[Firebug - 关键词]

Firebug

[Firebug - 论坛]

http://groups.google.com/group/firebug

[Firebug - Console控制台视图]

console API文档, http://www.getfirebug.com/console.html console.time()用于计算时间

console.info显示(i)图标


在输出时,需要注意第一个参数被自动识别为格式字符串

需要在页面加载前启动firebug,当页面加载后启动firebug时,就没有console对象


[Firebug - HTML页面视图]

Show Computed Style不显示所有可用的样式

标记的显示也会与源代码不同,而是按照Firefox对文档结构的解析显示的

在页面上右击弹出菜单中选择Inspect Element菜单项,能起到与Inspect按钮相同的作用。



[Firebug - CSS样式表视图]

Edit编辑模式下切换文件不能保持Edit编辑模式

[Firebug - script脚本视图]

使用step into, step over等按钮需要预先设置javascript脚本的断点

Options中的BreakOnErrors项用于捕获javascript出错事件,不受javascript脚本中的try/catch影响





[Firebug - DOM文档结构视图]

页面中包含不断执行的AJAX时,DOM视图也将不断刷新,此时可以在script视图中AJAX脚本处设置断点避免DOM视图刷新。

借助Show User-defined Properties选项查看javascript全局变量

[Firebug - Net网络视图]

有进度条,绿色,正在读取

有进度条,深灰色,向服务器端发送请求,从服务器端返回文件

有进度条,浅灰色,向服务器端发送请求,服务器端返回未修改,加载本地缓存文件

无进度条,未向服务器发送请求,直接从本地缓存加载文件

[Firebug - 其他问题]

不支持IE Tab
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐