【发布时间】:2012-05-12 10:00:41
【问题描述】:
有人告诉我,使用console.log()方法后,我不需要警告框并准备了一些代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script>
function cool()
{console.log("Message");}</script>
</head>
<body onload="cool();">
</body>
</html>
但它不会像警告框那样让 JavaScript 停止运行。它还在向 Firebug 窗口写入“消息”。
它在没有 Firebug 的客户端浏览器上如何工作?
它是否适用于所有使用相同语法的浏览器?
它是否仅用于 Web 开发目的?
【问题讨论】:
标签: javascript html function console