根據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=「」>是不兼容的.瀏覽器
注:文章來源於轉載。安全