开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜