이 잘 작동 단어 'TEST'는 <body>
javascript - document.write 오류?
에 추가됩니다 그러나
<script type="text/javascript">
window.onload = function(){
document.write('TEST');
}
</script>
를 사용하는 경우, 다음 본문 내용이 완전히입니다 ..
<html>
<head>
<script type="text/javascript">
document.write('TEST');
</script>
</head>
<body>
Some body content ...
</body>
</html>
을 스크립트를 고려 'TEST'라는 단어로 바뀝니다. 예를 들어 오래된 내용이 제거되고 'TEST'라는 단어 만 추가됩니다.
이 document.write
은 내가 크롬이 시도 window.onload
기능
내에서 호출 한 경우에만 발생합니다. 나 한테 실수 한거야? 어떤 제안?