首页 > 解决方案 > 我在 Chrome 上看到此错误,但在 Firefox 上没有看到

问题描述

我在 Chrome 上看到一个错误,但在 Firefox 上看不到这个错误。

Uncaught TypeError: Cannot read property 'nodeName' of null
at _e (index.js:63)
at MutationObserver.<anonymous> (index.js:63)

我的代码:

        <button onclick="typeWriter()">Click me</button>

        <p id="demo"></p>

        <script>
            var i = 0;
            var txt = ['var hackedman = world.getUserByIpAdress("32.312.323.320") e','oldu'];
            var array = 0
            var speed = 50;

            function typeWriter() {
                if (array < txt.length) {
                    if (i < txt[array].length) {
                        document.getElementById("demo").innerHTML += txt[array][i];
                        i++
                    }
                    if (txt[array].length == i) {
                        document.getElementById("demo").innerHTML += "<br>"
                        i=0
                        array++
                    }
                    setTimeout(typeWriter, speed)
                }
            }
        </script>

我在https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_typewriter上获得此代码

标签: google-chromefirefoxconsole

解决方案


推荐阅读