把脚本标签放在 body 结束标签 (</body>) 之后有多错误?
<html>
....
<body>
....
</body>
<script type="text/javascript" src="theJs.js"></script>
</html> Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
它不会在
元素之前进行DOM操作可能会破坏IE,否则它也不会产生太大的差异-将其放在关闭之前。<body>或<head>标签之外进行验证。除非您在完全加载<html> .... <body> .... <script type="text/javascript" src="theJs.js"></script> </body> </html>