哪些浏览器支持console.log()? [英] Which browsers support console.log()?

查看:262
本文介绍了哪些浏览器支持console.log()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有浏览器都支持此功能吗?我想使用 console.log()输出一个错误,但是想知道这是否支持所有浏览器?

Do all browsers support this? I would like to output an error using console.log() but was wondering if this supported by all browsers?

console.log("Error etc");


推荐答案

否,并非所有浏览器都支持 console.log ,因为它不是标准的一部分,是DOM的扩展,因此你不应该依赖它的存在。为了使您的代码具有弹性,您应该假设不存在并相应地编码。

No, not all browsers support console.log as it is not part of the standard and is an extension of the DOM and thus you should not count on its presence. To make your code resilient you should assume it does not exist and code accordingly.

这篇关于哪些浏览器支持console.log()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆