JavaScript is a scripting language, mainly used in the browser, to achieve the Web page of the Document object operation and some user interaction action processing. While JQuery is a code base for JavaScript (or a habitual class library), it combines some of the features that are often used in JavaScript development, provides a simple function interface, simplifies the operation of JS, and enables consistent results across different browsers. is one of the most popular JavaScript libraries today. As for the connection between the programming language and the code base, for example, the programming language is the raw material, the codebase is the semi-finished material made of raw materials, and your program project is the finished product. You can choose to use the raw material directly, or you can choose to add some semi-finished products. Of course, with raw materials, you can be more free, and semi-finished products are more efficient.
1. JQuery, as a code base for JavaScript, is naturally written in JavaScript language.
2. JQuery's code is very prescriptive and execution is very efficient, and is a good example of JavaScript coding.
3. In many cases, the most JavaScript functionality can be achieved with the jQuery approach.
First, the $ (document) in jquery. Ready () is similar to the Window.onload method in traditional JavaScript, but differs from the window.onload approach.
1. Execution Time
Window.onload must wait until all the elements of the page that include the picture have been loaded before they can be executed.
$ (document). Ready () is executed when the DOM structure is drawn and does not have to wait for the load to complete.
2. Different writing numbers
Window.onload cannot write multiple at the same time, if there are multiple window.onload methods, only one
$ (document). Ready () can be written multiple at the same time and can be executed
3. Simplified notation
Window.onload No simplified notation
$ (document). Ready (function () {}) can be simply written as $ (function () {});
Second, other examples: http://www.jb51.net/article/61640.htm
Compare jquery with JavaScript