文章目录

在控制台输出

    function showLog(message) {
        console.log(message);
    }
    
    function test(name) {
        showLog(name);
    }

    test("hello");

Firebug使用技巧
如果想要注释掉所有的输出,直接把 console.log(message);注释掉即可

        console.info(message);
        console.warn(message);
        console.error(message);
        console.debug(message);

Firebug使用技巧

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function method() {
            var result = 0;

            for (var i = 0; i < 10; i++) {
                result += i;
            }

            document.getElementById("id1").innerHTML = result;
        }
    </script>
</head>
<body>
<input type="button" value="click" onclick="method();">
<div id="id1"></div>
</body>
</html>

Firebug使用技巧

相关文章:

  • 2021-06-26
  • 2022-12-23
  • 2021-05-31
猜你喜欢
  • 2021-10-25
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-01-14
  • 2022-01-09
相关资源
相似解决方案