Getting started with jQuery Article 1 _ jquery

Source: Internet
Author: User
This jquery entry-level article is really good, as long as you are familiar with JavaScript, you may understand it. It is a very good jquery entry-level article. I. Summary
Ii. Preface
Iii. What is jQuery?
JQuery is a Javascript script library. in my blog, I can find the "Javascript lightweight script library" series of articles. the Javascript script library is similar.. NET class library. We encapsulate some tool methods or object methods in the class library for your convenience.

Note that jQuery is a script library rather than a script framework. "library" is not equal to "framework". For example, "System assembly" is a class library, while "ASP. net mvc "is the framework. jQuery does not help us solve the Reference Management and function Management of scripts. These are what the script framework is doing.

The script library can help us complete the encoding logic and implement business functions. using jQuery will greatly improve the efficiency of writing javascript code and make the written code more elegant and robust. at the same time, the rich jQuery plug-ins on the network have turned our work into "drinking tea every day with jQuery"-because we have already stood on the shoulders of giants.

When you create an ASP. net mvc project, you will find that the jQuery class library has been automatically introduced. jQuery is almost a powerful script library of Microsoft! The perfect integration and smart sensing support allow. NET and jQuery to be seamlessly integrated! Therefore, to use. NET, you need to use jQuery instead of Dojo and ExtJS.

JQuery has the following features:

1. provides powerful functions to use these functions, which can help us quickly complete various functions and make our code very concise.

2. to solve the browser compatibility problem, the compatibility of javascript scripts in different browsers has always been a nightmare for Web developers. A page often runs normally in IE7 and Firefox, and some inexplicable problems occur in IE6. writing different scripts for different browsers is a pain point. with jQuery, we will wake up from this nightmare. For example, the Event event object in jQuery has been formatted as common in all browsers. In the past, we had to obtain the Event Trigger Based on the event, in ie, It is event. under the standard browser such as srcElements and ff, event.tar get. jqueryis a unified eventobject, so that we can use event.tar get in a browser to get the event object.

3. implementing a wide range of UIjQuery functions, such as gradient pop-up, layer movement, and other animation effects, gives us a better user experience. taking the gradient effect as an example, I wrote a gradient animation that is compatible with ie and ff. It was implemented using a large amount of javascript code, so it took a lot of effort to avoid it, after writing the script, I forgot it for a while without much help. it is effort-consuming to develop similar functions. now, using jQuery can help us quickly complete such applications.

4. I proposed the correct scripting knowledge, because most developers have a wrong understanding of javascript. for example, compile the DOM statement that is executed during loading on the page, directly add the "onclick" attribute to the HTML element or document object, and do not know that onclick is actually an anonymous function. technicians with these error scripts can complete all the development work, but such programs are not robust. for example, "write the DOM statement that is executed when loading in the page", there is no problem when the Page code is very small and users load quickly, when the page loading is slow, the browser "stop operation" error will occur. jQuery provides a lot of simple methods to help us solve these problems. Once jQuery is used, you will be able to correct these errors-because we all use standard and correct jQuery scripting methods!

5. Too many! Waiting for us to find out one by one. 4. Hello World jQuery
By convention, we compile the jQuery Hello World Program to take the first step of using jQuery.

At the end of this article, you can go to the complete source code in this chapter.
1. Download The jQuery class library

The jQuery project is downloaded on Google Code ,:

Http://code.google.com/p/jqueryjs/downloads/list href = "http://code.google.com/p/jqueryjs/downloads/list" target = _ blank> http://code.google.com/p/jqueryjs/downloads/list

The above address is the total download list, which contains many versions and types of jQuery libraries, mainly divided into the following categories:

Min: Compressed jQuery class library, used in the formal environment. For example: jquery-1.3.2.min.js

Vsdoc: in Visual Studio, You need to introduce this version of jquery class library to enable intelligent sensing. For example: jquery-1.3.2-vsdoc2.js

Release package: There is no compressed jquery code, as well as documentation and sample programs. For example: jquery-1.3.2-release.zip

2. Compile a program to create an HTML page, introduce the jQuery class library, and write the following code:

The Code is as follows:





Hello World jQuery!

Related Article

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.