jQuery学习

2017/02/12 iteye
  1. jQuery, window.jQuery, window.$ or simply $ can be used interchangeably   2.  window.onload 和 $(document).ready(function())        // Override the onload event window.onload = function(){

// the page finished loading, do something here...

}   This code actually overrides the onload event of the HTML tag. All this means to us is that our code will be executed soon as the page is finished loading. It makes sense because sometimes pages take time to load, or the downloading process is segmented by the browser architecture.     The jQuery internal architecture also utilizes the window.onload event, but before it does so, it checks whether the entire DOM (document object model) has been loaded because it is very important. It is not enough for jQuery to know that the page has been loaded, we must ensure that the DOM has been fully constructed. To provide us with this functionality, jQuery gives us a new method called ready that we can call on the main jQuery object itself.

Search

    Table of Contents