JavaScript face object design _ js object-oriented

Source: Internet
Author: User
The advanced realm of learning JavaScript is to use object-oriented methods to call JavaScript. A new article: Comparison of strings in JavaScript
The Application of face object is quite extensive. It has long been used in desktop programming and has mature applications, such as C ++, Java, and C. The emergence of Web programming is much later, so that the current Web development is very difficult. Of course, there are also many reasons why Web development involves many technologies. In recent years, object orientation has gradually been introduced in Web development. Many large websites are developed using PHP. in PHP 4, object orientation is not perfect, and PHP 5 has been improved .. Net is also object-oriented, but the execution efficiency is not as high as that of PHP.

JavaScript is also widely used in Web development, and many common forms are used for verification. JavaScript, as a scripting language, does not have a special IDE development environment or a good debugging tool. It is quite slow to develop and has never been noticed. It was not until Ajax came into being. And let people really see the effect it brings to other technologies.

JavaScript is contained in the object, but it is not widely used in applications.

Let's look at a simple example:

Define the CTest class // CTest. js
Function CTest ()
{
This. m_sStr = "";
This. Input = CTest_Input;
This. Output = CTest_Output;

Function CTest_Input (str)
{
This. m_sStr = str;
}
Function CTest_Output ()
{
Alert (this. m_sStr );
}
}
Usage

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.