Javascript features, advantages and disadvantages, and common frameworks

Source: Internet
Author: User
Tags mootools

1. What is JavaScript?
Javascript is a client scripting language that is based on objects and event-driven and secure. It is also a scripting language widely used in client web development. It is often used to add dynamic functions to HTML web pages, such as responding to various user operations. Originally designed by Brendan eich of Netscape, Netscape is a dynamic, weak-type, prototype-based language with built-in support classes.

2. Features of JavaScript
(1). An interpreted scripting language.
Like other scripting languages, JavaScript is also an explanatory language, which provides a very convenient development process. The basic structure of JavaScript syntax is similar to that of C, C ++, and Java. But before using it, unlike these languagesProgramIt is explained line by line during running. JavaScript and HTML tags are combined to facilitate user operations.

(2). An object-based scripting language.
It can also be seen as an object-oriented language, which means that javascript can use the created objects. Therefore, many functions can come from the interaction between methods of objects and scripts in the script environment.

(3). A simple and weak scripting language.
Its simplicity is mainly reflected in: first, JavaScript is a simple and compact design based on the Basic Java statements and control flow, so that users can learn Java or other C-languageProgramming LanguageIt is a very good transition, and for programmers with C programming skills, JavaScript is also very easy to get started; secondly, its variable type is weak type, strict data types are not used.

(4). A relatively secure scripting language.
As a security language, JavaScript is not allowed to access local hard disks, store data on servers, and modify or delete network documents, information Browsing or dynamic interaction can only be achieved through a browser. This effectively prevents data loss or illegal access to the system.

(5). An event-driven scripting language.
Javascript responds to users in an event-driven manner. An action generated by an operation on a web page is called an event ). For example, pressing the mouse, moving the window, and selecting a menu can all be regarded as events. When an event occurs, it may cause the corresponding Event Response and execute some corresponding scripts. This mechanism is called "event-driven ".

(6). A cross-platform scripting language.
Javascript depends on the browser itself and has nothing to do with the operating environment. As long as the computer can run the browser and support the Javascript browser, it can be correctly executed, thus realizing the dream of "writing once, going all over the world.

Therefore, JavaScript is a new descriptive language that can be embedded into HTML files. The javascript language can respond to user requirement events (such as form input) without any network to transmit data back and forth. Therefore, when a user inputs a data item, the data does not need to be sent to the server for processing and then transmitted back, but can be directly processed by the client application.

3. Advantages and Disadvantages of JavaScript
(1) Advantages of javascript:
<1>. Javascript reduces network transmission.
Before the emergence of a client scripting language such as JavaScript, the traditional data submission and verification work was carried out by the client browser over the network. If the data volume is large, this is an invisible waste for network and server resources. With JavaScript, you can perform data verification on the client.

<2> JavaScript allows you to easily manipulate HTML objects.
Javascript allows you to easily manipulate objects on various pages. You can use JavaScript to control the appearance, status, and even running mode of each element on the page. javascript can be customized based on your needs, this makes the webpage more friendly.

<3>. Javascript supports distributed operations.
Javascript allows multiple tasks to be completed only on the user end, without the involvement of networks and servers, thus supporting distributed computation and processing.

(2) Limitations of javascript:
<1> browser vendors have different levels of support for JavaScript.
Currently, there are many browsers on the Internet, such as Firefox, Internet Explorer, and opera. However, each browser supports JavaScript to a different extent. When different browsers browse a home page with JavaScript scripts, because the support for Javascript is slightly different, there may be some difference in the effect, and sometimes it may not be displayed.

<2>. Web security sacrifices some JavaScript Functions.
When a javascript design goal is set to "Web security", some functions of JavaScript need to be sacrificed. Therefore, pure JavaScript cannot open, read, write, and save files on your computer. The only information that the user has the right to access is the information on the web page embedded in the Javascript. In short, JavaScript will only exist on its own web page.

4. Introduction to common JS frameworks and their advantages and disadvantages
(1). jquery
<1>. Introduction
Jquery is an excellent JS Development Library class like prototype, especially its support for CSS and XPath makes it easier for us to write JavaScript! If you are not a JS guru and want to write excellent JS results, jquery can help you achieve your goal! In addition, the introduction syntax and high efficiency have always been the goal of jquery.
<2>. Advantages: Focus on introduction and efficiency. js effects include the Yui-ext option, because Yui-ext reuse many jquery functions.
<3>. Disadvantages: It is said that it is too tender and has a long history.

(2 ). EXT
<1>. introduction
Yui-Ext, an extension package based on Yahoo UI, is a CS-style Web user interface component that can implement complex layout, and the interface effect can be comparable to that of backbase, it is also developed using pure JavaScript Code . The real editable table edit grid supports XML and JSON data types and can be directly migrated to the grid. Many components support data sources, such as dynamic layout, editable table controls, Dynamically Loaded tree controls, and dynamic drag and drop effects. We have been cooperating with jquery since version 1.0 beta and launched jquery-based ext 1.0, which provides more interesting functions.
<2>. advantage: structured, similar to the Java structure, is clear and clear. Some jquery functions are used at the underlying layer to enable integration and use. The most important thing is that the interface is too shocking.
<3>. disadvantage: The whole interface is too complex to be constructed.

(3). dojo
<1>. Introduction
Dojo is currently the most powerful JS framework. It defines itself on its own wiki. dojo is an open-source DHTML toolbox written in JavaScript. Dojo really wants to be a "unified" toolbox. It is not only browser-level, but also ambitious. Dojo includes Ajax, browser, event, widget, and other cross-browser APIs, including JS language extensions, tool libraries in various aspects, and a relatively complete UI component library, it is also widely used in many projects. Its UI component is characterized by adding tags to HTML tags, rather than generating them by writing JavaScript, the dojo API imitates the Java class library organization. It is very convenient to use dojo to write web OS. Dojo is now 4.0. The powerful feature of dojo is the encapsulation of interfaces and special effects, which allows developers to quickly build compatible standard interfaces.
<1>. advantage: the Library is quite complete and has been developed for a long time and has powerful functions. It is said that I/O of dojo is used. BIND () enables comet to see its powerful and extraordinary functions, and is supported by IBM and sun.
<2>. disadvantage: the file size is relatively large, more than 200 kb, and the initial download is quite slow. In addition, the use of the dojo class library is not so easy, and the JS syntax is not as enhanced as prototype.

(4). Prototype
<1>. Introduction
It is a very elegant JS library that defines JS object-oriented extensions, Dom operation APIs, events, and so on, with prototype as the core, it has formed a variety of peripheral JS extension libraries and is a promising underlying JS framework, which is recommended, it seems that it is also the most widely used library class in reality (the Ajax JS library integrated by ROR). There is also scriptaculous to implement some JS component functions and effects.
<2>. Advantages: basic underlying layer, easy to learn and use, and even the underlying layer of some other JS special effects Development kits, the size is the smallest.
<3>. disadvantage: If it is said, it may be that the function is his weakness.

(5). dscriptaculous
<1>. Introduction
Scriptaculous is a JS effect based on the prototype. js framework. It contains 6 JS files and different files correspond to different JS effects. Therefore, if prototype is used at the underlying layer, it would be appropriate to use scriptaculous for JS effects, even the famous Digg is using him.
<2>. Advantage: Prototype is the biggest advantage. Due to the extensive use of prototype, it is undoubtedly a icing on the cake of the user book.
<3>. Disadvantages: just emerging, it takes time to hone

(6). mochikit
<1>. Introduction
Mochikit claims to be a lightweight JS framework. Mochikit is inspired by the many conveniences provided by the python and Python standard libraries, and also relieves inconsistency between browser versions. Among them, mochikit. Dom is especially convenient and can process DOM objects in a more friendly way than the original JavaScript. Most of mochikit. Dom is customized for XHTML documents. If it is combined with mochikit and Ajax, it is particularly convenient to use the XHTML-encapsulated microformat. Mochikit can directly format the output string or number, which is more practical and convenient. It also has its own JS Code interpreter.
<2>. Advantages: mochikit. Dom is very practical and the introduction is outstanding.
<3>. Disadvantages: lightweight disadvantages

(7). mootools
<1>. Introduction
Mootools is a simple, modular, and object-oriented JavaScript framework. It helps you write scalable and compatible JavaScript code faster and simpler. Mootools is similar to prototypejs, with almost the same syntax. However, it provides more functions than prototypejs and is more powerful. Such as adding animation effects and drag-and-drop operations.
<2>. Advantage: You can customize the functions you need. It can be said that it is an enhanced version of prototypejs.
<3>. Disadvantages: it is not small. Specific Application Analysis.

(8). Moo. FX
<1>. Introduction
Moo. FX is a super lightweight JavaScript special effect Library (7 k) that can be used with prototype. js or mootools frameworks. It is fast, easy to use, cross-browser, compliant with standards, and provides control and modification of CSS attributes of any HTML element, including colors. Its built-in checker prevents users from damaging the effect through multiple or crazy clicks. Moo. FX adopts a modular design, so you can develop any special effects you need based on it.
<2>. Advantages: small block headers are highly capable.
<3>. Disadvantages: It's good if it's so small.

Refer to blog:
Javascript features
Advantages and limitations of JavaScript
Introduction and Comparison of eight JavaScript frameworks

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.