本人是新手,所以就記錄下來了。這個答案是在百度中看到的,所以算是轉載。
下面的內容解答了何為如果在頁面加載完后如果調用document.write就會覆蓋整個文檔。
提示中的 【HTML 輸出中】 指的是當頁面加載的時候。
復制代碼 代碼如下:
<html>
<head></head>
<body>
<script type="text/javascript">document.write("<p>Hello</p>");</script>
</body>
</html>
復制代碼 代碼如下:
<html>
<head></head>
<body>
<script type="text/javascript">
// 當點擊鼠標時調用 document.write
document.onclick = function() {
document.write("<span>Javascript</span>");
};
</script>
</body>
</html>
新聞熱點
疑難解答
圖片精選