开发者

Why does my browser still show the loading icon after I clicked the button?

开发者 https://www.devze.com 2023-03-25 21:41 出处:网络
Why does my browser still show the loading icon after I clicked the button? jsfiddle.net/QuwUF/1 <script type=\"text/javascript\">

Why does my browser still show the loading icon after I clicked the button?

jsfiddle.net/QuwUF/1

<script type="text/javascript">
    f开发者_如何学编程unction printName(name){
        var message= document.write("hi " + name);
        return message;
    }
</script>


<form>
    <input type="button" onclick='printName("scotty")' />

</form>


You (implicitly — by calling document.write() on a closed document) open a new document, but after you write to it, you never call document.close() so it never finishes "loading".

0

精彩评论

暂无评论...
验证码 换一张
取 消