The JavaScript Window object is the highest level JavaScript object which corresponds to the web browser window. 最外层的JavaScript对象其对应于web浏览器窗口 The document object is the container for all HTML HEAD and BODY objects associated within the HTML tags of a…
jQuery $(document).ready()和window.onload 根据ready()方法的API说明http://api.jquery.com/ready/. 这个方法接收一个function类型的参数ready(handler), 方法的作用是: Specify a function to execute when the DOM is fully loaded. 即当DOM加载完毕的时候,执行这个指定的方法. 因为只有document的状态ready之后,对page的操作才是…
原文地址: $(document).ready vs $(window).load vs window.onload $(document).ready We execute our code when DOM is ready except images. //call type 1 $(document).ready(function() { /** work when all HTML loaded except images and DOM is ready **/ // your co…