What is a javascript framework (copy)

Source: Internet
Author: User

Summary: Modern websites and web applicationsProgramTends to rely on a large number of clientsJavascriptTo provide rich interactions. In particular, you can return data or get a response from a server script (or data system) by not refreshing the asynchronous request of a new page. In this articleArticleYou will learn how the Javascript framework can create highly interactive websites and web applications faster and more conveniently.

Introduction: Javascript is an object-oriented scripting language that has always been used as a choice for client scripting interfaces of Web browser applications. Javascript allows web developers to program and work with objects on webpages, providing a platform for operating these objects out of thin air. When JavaScript was first launched, it was generally used to provide some trivial functions, such as clock and scrolling text in the browser status bar. Another common feature is "rolover link", which means that when a user's mouse slides over an object, the text color or background image changes. However, in recent years, Ajax has brought about a new interaction for network programming, and JavaScript has become more useful. Before Ajax, any server processing or database access requires the whole page to be refreshed or displayed by a browser. This not only slows down users, but also wastes bandwidth and resources.

Ajax is Asynchronous JavaScript and XML. Although the referenced XML is not valid, AJAX can respond to data in other formats than XML, such as JSON (JavaScript Object Notation ). The working principle of AJAX is to submit an HTTP request asynchronously to the Web server, neither refreshing nor rendering the entire page, but only displaying the response content. On the contrary, developers usually use dom (Document Object Model) operations to modify part of a webpage, and the data returned by the HTTP response will reflect these changes.

What is a javascript framework?

Javascript itself is a very powerful language. You can create a rich Internet Application System (RIA) supported by it without any additional framework ). However, using JavaScript is not easy, mainly because of the appearance of various complications when trying to provide support for multiple browsers. Like HTML and CSS, different browsers have different javascript execution methods, so make sure that your JavascriptCodeCross-browser compatibility is a nightmare.

OneJavascript frameworkOr the library is actually a series of tools and functions, which can more easily generate cross-browser compatible JavaScript code. Each library is strictly tested in many popular Web browsers of the latest version. Therefore, you can fully believe that using any of these frameworks, your JavaScript-based Ria will be roughly the same in different browsers and platforms.

In addition to browser compatibility, the Javascript framework can easily write code to retrieve, traverse, and manipulate DOM elements. They not only provide a quick function to get reference to a DOM element, but also allow chrysanthemum Dom traversal function chain to find parent, child, or any deep sibling node element. Finally, the framework provides a series of functions to make it easier to manipulate these objects, allowing them to change, add, or delete their content, or manipulate the style of the class to influence the appearance of the elements.

Javascript frameworkAnother important feature is better support for event processing. Because of the different implementations of browsers, cross-browser event processing is a nightmare. Therefore, JavaScript frameworks usually wrap browser events and provide a series of useful cross-browser functions to handle them. Some frameworks also provide standardized events that represent the keyboard key code series (such as ESC, enter, and cursor ).

All these functions are very useful, and the Javascript framework has played an important role in its recent popular Ajax applications. Like other aspects of JavaScript, each web browser tends to support Ajax in different ways, making Ajax support for all browsers very heavy. Almost all JavaScript frameworks include some forms of Ajax libraries, usually provide Ajax requests and response objects. After evaluating the response, update the DOM element and round-robin a specific request.

Typical features of a javascript framework

Now let's take a look at some functions of most JavaScript frameworks. These features include:

    • Selector
    • Dom Traversal
    • Dom operations
    • Practical Functions
    • Event Processing
    • Ajax

To better interpret these features, I will list one or more examples of JavaScript frameworks: Prototype, jquery, Yui, extjs, and mootools. Although the execution and syntax of each framework are different, their concepts are roughly the same. Each framework has a detailed api reference. You can refer to it to determine how to use the features of these specific libraries.

 

 

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.