Compare jquery with JavaScript

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.