<分区>
有时我会在 $("document").ready()
函数中得到很多代码,这些函数通常位于 .html
文件中。
$("document").ready(function() {
// The DOM is ready!
// Let the DOM manipulation begin!
});
定位 $("document").ready()
的最佳做法是什么。它是否应该在不同的 .js
文件中并使用以下方法包含在 HTML 中:
<script src="MyDocReadyJS.js"></script>