(4)事件处理——(5)为代码简洁做的快捷方式(Shortcuts for code brevity)
The $(document).ready()construct is actually calling the .ready()method on a jQuery object we've constructed from the documentDOM element. The $()function provides a shortcut for us as this is a common task. When we pass in a function as the argument, jQuery performs an implicit call to .ready(). For the same result as shown in the following code snippet:
$(function() {// Our code here...});虽然另一种语法更加短,但是这个长的让更好的描述了他在做的事情。由于这个原因,我们将在整本书中使用长一些的语法。