显示顺序
1.显示提示框(此时页面一片空白)
2.点确定后正常显示HelloWorld
<body>
<script>
document.write("<h1>HelloWorld</h1>");
document.write("<h1>HelloWorld</h1>");
alert("你好");
</script>
</body>
为什么页面会先显示alert()框,而不是先显示HelloWorld,我的代码明明是HelloWorld写在上面?
栗子:比如你有一天去饭店, 告诉老板要吃火锅了,他再给你上火锅的路上, 你出去接了个电话 他已经把火锅端上来了(但是你没看到,你走进去才会看到) (
阻塞了
)