Marvel at jquery (solve the jquery object-to-dom conversion)

Source: Internet
Author: User

jquery is a JavaScript framework, but it is definitely not the usual sense of some packaging, the personal feeling is a Change JS control mode framework. We can separate the page and effect with jquery, just like the artwork by writing CSS to detach the page code. Here's a brief introduction:

jquery has some of the following features: Concise code,:1.            , fast learning, and rich documentation. 2.            jquery is a lightweight script with very small code, The latest version of the JavaScript package is only about 20K. 3.            jquery supports CSS1-CSS3, as well as basic XPath. 4.            jquery is a cross-browser, it supports browsers including IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+. 5.             can easily extend additional functionality for jquery. 6.             can completely separate the JS code from the HTML code, making it easy to code and maintain and modify. 7.             plug-in rich, in addition to the jquery itself with some special effects, can be achieved through the plug-in more functions , such as Form validation, tab navigation, drag-and-drop effects, table sorting, DataGrid, tree menus, image effects, and Ajax uploads.         jquery design will change the way you write JavaScript code, reduce the complexity of your learning to use JS to operate the Web page, improve the efficiency of Web page JS development, Whether for JS beginner or senior expert, jquery will be your first choice.        JQUery is suitable for designers, developers, and those who are good for business development, and it can be said that jquery is suitable for any JavaScript application and can be used in different Web applications. Official site:http://jquery.com/   Chinese site:http://jquery.org.cn/      after using jquery, And found some uncomfortable places.:         1. A large number of callbacks (similar to the use of anonymous inner classes in Java) are used in the format. Cause the code is not good to read, the more troublesome is that accidentally will be lost}), the Terminator, resulting in JS failure. Debugging JS is a painful process.            2. Objects that are obtained by using ${} are jquery objects that result in functions in the DOM that are invalidated by the event. For example a <input type= "checkbox" id= "AAA"/&gt, using $ ("#aaa") to get the jquery object, but $ ("#aaa"). Checked will go wrong  jquery use your own API, Incompatible with standard JS.    p.s. Resolve the conversion of jquery to DOM objects: <input type= "checkbox" id= "AAA"/>1. Use $ ("#aaa") to get the jquery object. Use $ ("#aaa") [0] to get the DOM object, $ ("#aaa") [0].checked is used correctly.  2. The jquery API mentions a Get () function that resolves an object-to-dom conversion. Get () gets a collection of all matching DOM elements. This is a backward-compatible way of getting all matching elements (unlike jquery objects, which are actually array of elements). This function is useful if you want to manipulate DOM objects directly instead of JQuery objects. --------------------------------------------------------------------------------Access all matched DOM elements. This serves as a backwards-compatible WAy of accessing all matched elements (other than the JQuery object itself, which are, in fact, an array of elements). It is useful if you need to operate on the DOM elements themselves instead of using built-in JQuery functions. return value ARRAY&LT ; Element>

     notes that the returned queue, $ ("#aaa"). Get () [0] returns the INPUT element of the current DOM. $ ("#aaa"). Get () [0].checked use error-correct

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.