根据ready()方法的API说明http://api.jquery.com/ready/。jquery
这个方法接收一个function类型的参数ready(handler), 方法的做用是: Specify a function to execute when the DOM is fully loaded.api
$( document ).ready( handler ) $().ready( handler ) (this is not recommended) $( handler )
<body onload="inlineBodyOnloadTimeCounter();">
The .ready() method is generally incompatible with the attribute. If load must be used, either do not use .ready() or use jQuery's .load() method to attach load event handlers to the window or to more specific items, like images.
说明ready()方法和<body onload=“”>是不兼容的.浏览器
注:文章来源于转载。安全