欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

javascript 在firebug调试时用console.log的方法_javascript技巧

程序员文章站 2022-05-14 16:23:41
...
console.log();

当你使用console.log()函数时,下面的firebug一定要打开,不然这函数在用firefox运行时无效且影响正常程序,如果用IE打开,将会出错。


第一个参数可以是一个包含格式化占位符输出的字符串,例如:

console.log("The %s jumped over %d tall buildings", animal, count);

格式化字符串 类型
%s 字符串
%d, 整型
%i (暂不支持数字型)
%f 浮点型 (暂不支持数字型)
%o 链接对象

console.log()用法
复制代码 代码如下:





javascript的console.log()用法





相关标签: firebug console.log