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…