[Goto] jquery Source Analysis-How to do jquery source analysis

Source: Internet
Author: User

jquery Source Analysis Series (continuous update)

jquery source code is somewhat obscure, this article share some of the methods I look at the source code, each module I basically follow this order to learn.

When I read the difficulty of the book or the source code, and "How to read a book" together to learn. It is recommended to read this book, which you can download from here and here.

Part I: Viewing reading

1. Collection of reference materials : Official documents, books, Baidu/Google, topics/blogs, etc., a quick tour of the knowledge points involved, scope, depth, whether there is a reference to the meaning of the general understanding and judgment, know the author of these articles want to explain or solve any problem.

Part II: Analysis of Reading

2. Read the official documents , the official has very detailed documentation, open the translation tools, the words do not understand the timely verification, do not start to read the Chinese API, because a lot of machine translation, after reading frustration, and the Chinese API mutual proof, deepen understanding.

3. Verify the official example

Open Firebug or Chrome's Debugging tools, enter commands in the console to verify, or open http://jsfiddle.net/, manually enter HTML, CSS, JavaScript, or Ajax, to build your own server and service-side programs.

In this step, the function of the API, use has been initially mastered, to maintain this learning habit, can quickly become a jquery skilled workers. But it's an early stage, but it's just a little bit of knowledge (what), knowing how to apply it, and figuring out how to design and implement the API (why), but with the groundwork in front of it, you can finally start reading the source code.

4. Start reading the source code

first , the structure of the module is collated, from the overall understanding, such as the overall structure, the event source code;

next is to read side by side annotated , each line of code for each function call to carve fastidious, feel interesting, amazing, doubtful, pit dad, speculation, inspiration, association, etc. Write down the process and results of these thoughts in detail (be assured that jquery is worth your time, and you will experience the fun and soon find it worthwhile);

While reading the side of the annotation process, design some test cases , in the Debugging tool (I found that chrome is more useful than Firebug) set breakpoints, through the single-step debugging to verify the correction of my understanding;

finally , we summarize the implementation of the API and key code , this step is the most important 2 results.

I have summed up the experience is that their own initiative to analyze , do not see other people's analysis. Reasons, such as the version of the problem, the author's level and patience, and most importantly, I found that before I read the source code, I often do not understand these articles.

Part III: Theme Reading

5. read the relevant web and books (the 1th Step), focus on the same topics of the analysis of documents, online frequently asked questions, etc., in the process of reading constantly revise and improve their understanding.

It also requires constant debug.

6. Write an application tutorial (excellent application tutorials have been a lot of, time will write, but not many).

7. Write a source code analysis , record their own experience, deepen understanding and memory.

The analysis of the jquery source code is to grow to Intermediate Jser A shortcut, I hope that everyone can be inspired.

Original: http://www.cnblogs.com/nuysoft/archive/2011/12/08/2280855.html

[Goto] jquery Source Analysis-How to do jquery source analysis

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.