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.05Firebug 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相关文章推荐
- Firefox - 附加软件 - Firebug - Console控制台视图 - 使用console.time()计算时间
- Firefox - 附加软件 - Firebug - Console控制台视图 - console.info显示(i)图标
- Firefox - 附加软件 - Firebug - Script脚本视图 - 使用step into, step over等按钮需要先设置javascript脚本的断点
- Firefox - 附加组件 - 扩展 - Firebug - console控制台面板 - 提供console控制台对象
- Firefox - 附加软件 - Firebug - Script脚本视图 - 使用step into, step over等按钮需要先设置javascript脚本的断点
- Firefox - 附加软件 - Firebug - Script脚本视图 - 在页面加载过程中的脚本设置断点
- Firefox - 附加软件 - Firebug - DOM文档结构视图 - “冻结”被AJAX不断更新的DOM视图
- Firefox - 附加软件 - Firebug - Net网络视图 - Open in New Tab在新标签中打开
- Firefox - Firebug附加软件 - HTML页面视图 - Inspect Element
- Firefox - 附加软件 - Firebug - DOM视图 - 借助Show User-defined Properties选项查看javascript全局变量
- Firefox - 附加软件 - Firebug - Net网络视图 - 可以用来检查一个页面中未能加载的引用内容
- Firefox - 附加软件 - Firebug - Script脚本视图 - Options选项 - Break on All Errors在所有错误处中断
- Console 控制台 字符串输入的格式问题
- 工作笔记:ajax json 同一jsp页面中,把java变量赋给js变量,如果java变量字符串符合json格式,则赋给js变量时,js变量会自动的变为json对象
- json字符串转换成对象需要注意的问题
- 在firebug中使用console对象输出调试信息
- JNI 传字符串参数,只输出了第一个字符
- php——学习笔记,printf输出字符串格式参数
- js拼接字符串时,字符串的事件参数需要传对象或对象数组的处理方法
- 在FireFox的firebug控制台输出调试信息