javascript在firebug调试时用console.log

console.log();

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

 

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

console.log("The %s jumped over %d tall buildings", animal, count);
 
 格式化字符串      类型
%s                  字符串
%d,                  整型
%i                   (暂不支持数字型)
%f                   浮点型 (暂不支持数字型) 
%o                  链接对象

 

原文地址:https://www.cnblogs.com/lufy/p/2491820.html