jQuery entry function:
Features: 1. waiting for completion of the DOM structure render the internal code can be executed, without waiting for all external resources to load, jQuery help us complete the package.
2 is equivalent to the native js DOMContentLoaded.
3. different from the load event is native js etc. page document, external js files, css files, images loaded before the implementation of internal code.
method one:
$(document).ready(function(){
... // Here is the page DOM has finished loading entrance
});
Second way:
$(function(){
... // Here is the page DOM has finished loading entrance
})
$ Is the top target of jQuery, JavaScript is equivalent to the native window, use the elements of $ packaged into a jQuery object, you can call the jQuery method.
. $ ( 'Div') hide (); // the div element, using the symbol $ jQuery packaged object, call the hide method
Version: 1x: compatible with IE lower version 678 other browsers
2x: IE is not compatible with earlier versions 678 and other browsers
3x: incompatible version of IE low 678 other browsers , the official website of the main version update maintenance
Documents download the official address: https: //jquery.com
Other versions Download: htts: //code.jquery.com