What is JavaScript framework

Source: Internet
Author: User
Tags object functions http request include key object model reference

Summary : Modern Web sites and Web applications tend to rely on a large number of JavaScript from clients to provide rich interaction. In particular, you can return data by not refreshing the page's asynchronous request or get a response from a server-side script (or data System). In this article, you will learn how the JavaScript framework can be faster and easier to create interactive, responsive Web sites and Web applications.

Introduction : JavaScript is an object-oriented scripting language that has long been used as a choice for Web browser application client-side scripting interfaces. JavaScript allows Web developers to programmatically work with objects on a Web page, providing a platform for manipulating these objects out of thin air. When JavaScript was first introduced, it was often used to provide trivial features such as clocks, scrolling text in the browser status bar. Another common feature is "rollover link", which changes the color or background picture of the text when the user's mouse hovers over the object. However, in recent years Ajax has brought new interactivity to network programming, and JavaScript has become more useful. Before Ajax, any server-side processing or database access requires that the entire page be "refreshed" or that a new page be rendered by the browser. This is not only slow, disappointing to users, but also a waste of bandwidth and resources.

Ajax is asynchronous JavaScript and XML, although referencing XML is not valid, but Ajax can respond to data in several other formats except XML, such as JSON (JavaScript Object notation). Ajax works by submitting an HTTP request asynchronously to the Web server without refreshing or rendering the entire page, rendering only the content of the response. Instead, developers typically use the DOM (Document Object model) operation to modify part of a Web page, and the data returned by the HTTP response reflects those changes.

What is a JavaScript framework?

JavaScript itself is a very powerful language, and you don't need any additional framework to create a rich Internet application (RIA) supported by it. However, using JavaScript is not an easy task, mainly because of the complications that occur when trying to provide multiple browser support. As with HTML and CSS, different browsers have different ways of doing JavaScript, so it's a nightmare to make sure your JavaScript code is cross-browser compatible.

A JavaScript framework or library is actually a series of tools and functions that make it easier to produce Cross-browser-compatible JavaScript code. Each library has been rigorously tested in many of the most popular and recent versions of Web browsers. Therefore, you can be confident that using any of these frameworks, your JavaScript based RIA will be broadly consistent across browsers and platforms.

In addition to browser compatibility issues, the JavaScript framework makes it easier to write code to fetch, traverse, and manipulate DOM elements. Not only do they provide a quick function to get a reference to a DOM element, but they also allow a daisy-style DOM traversal function chain to look up the sibling elements of a parent, child, or any depth. Finally, the framework provides a series of functions that make it easier to manipulate these objects, allowing their content to change, add, delete, or manipulate the style of the class to affect the appearance of the element.

Another important feature of the JavaScript framework is the ability to better support event handling. Cross-browser event handling can be said to be a nightmare because of the different implementations of browsers. As a result, the JavaScript framework usually wraps up browser events and provides a series of useful cross-browser functions to handle them. Some frameworks also provide a standardized set of events (such as Esc key, enter key, cursor, and so on) that represent the keyboard key sequence.

All of these features 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 a different way, so AJAX support for all browsers will be a heavy task. Almost all JavaScript frameworks include some form of Ajax library, typically providing AJAX request and response objects, updating the DOM element after evaluating the response, and polling for a specific request.

Typical features of a JavaScript framework

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

    • Selector
    • DOM Traversal
    • DOM Operations
    • Utility functions
    • Event handling
    • Ajax

To better illustrate these features, I'll enumerate an example from one or more of the JavaScript frameworks below: Prototype, JQuery, Yui,extjs, and MooTools. Although the implementation of each framework differs from the syntax, its concepts are broadly the same. Each framework has a detailed API reference that you can refer to to determine how to use these specific library features.



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.