Javascript prototype inheritance and class inheritance learning notes

Source: Internet
Author: User

After reading the basic Ajax tutorial, take notes.

I have not understood prototype inheritance and class inheritance. The following describes the generic functions written by Bob Clary:

Function createinheritance (parent, child) {var property; For (property in parent) {If (! Child [property]) {Child [property] = parent [property] ;}}

Bob Clary'sCodeFrom Page 148th of Ajax basic tutorial. This function is a reflection in Java/C.

To avoid the disadvantages of both and combine the advantages of both, the VaR class = new Native () {} of mootools may be such an "Oop idea.

Therefore, the class instance is: objecta = new classname ([property]).

Let's talk about my experience in "ajax basic tutorial", because xhr has mastered it early, so the content in Chapter 3 and Chapter 4 is mostly purely flipped, and innerhtml is what I learned in this book, cross-browser compatibility in the appendix is also a big gain. In addition, the two inherited programming ideas of JavaScript above are also gains.

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.