JavaScript (Introduction)

Source: Internet
Author: User

Learning a knowledge should understand its background, a lot of people think it will be done, at first I also think so, but then know the origin of understanding is also necessary, engaged in JavaScript development 5, today began to summarize some notes, share under.

A what is JavaScript

JavaScript is a kind of programming language with object-oriented ability and interpretive type. More specifically, it is a client-side scripting language that is Object-and event-driven and has relative security. Because he doesn't need to run in a language environment, it only needs to support its browser. Its main purpose is to verify the data sent to the server side, increase the Web Interaction, enhance the user experience and so on.

two. JavaScript features

Loose sex

The JavaScript language core is similar to C,C + +,Java , such as conditional judgment, loops, operators, and so on. However, it is a loosely typed language, which means that its variables do not have to have a definite type.

Object Properties

objects in JavaScript Map property names to arbitrary property values. It is much like a hash table or associative array, unlike a struct in C or an object in C + +orJava .

Inheritance mechanism

the object-oriented inheritance mechanism in JavaScript is prototype based, much like another self language that is not well known, and C + + and Java is very different from the inheritance in the.

three. JavaScript History

probably in 1992 year, there is a company Nombas develop a kind of called c--(c-minus-minus, abbreviation Cmm) embedded scripting language. Should feel the name compared to the unlucky, eventually renamed to scripease. The idea that this script can be embedded in Web pages will be an important cornerstone of the Internet.

1995years, at that time working inNetscape (Netscape)Brandon of the company(Brendan Eich)to resolve an issue similar to "validate before submitting data to the server". In theNetscape Navigator 2.0with theSunThe company has teamed up to develop a callLiveScriptscripting language. For marketing convenience, it was later renamedJavaScript (The aim is toJavaThe tree is good for the cool of the class).

because JavaScript 1.0 So successful, so Microsoft also decided to enter the browser, released the Internet Explorer 3.0 and a JavaScript version of the clone, called JScript (this is named to avoid the Netscape potential licensing disputes), and also provide their own VBScript .

after Microsoft entered, there was3different kinds ofJavaScriptversion exists at the same time:Netscape Navigator 3.0in theJavaScript,IEin theJScriptas wellCenviin theScriptease. With theCUnlike other programming languages,JavaScriptdoes not have a standard to unify its syntax or characteristics, and this3different versions highlight the problem. As the industry's fears increase, the standardization of the language is clearly imperative.

1997years,JavaScript 1.1submitted as a draft to the European Association of Computer Manufacturers (ECMA). Section theTechnical Committee (TC39) is delegated to "standardize the syntax and semantics of a generic, cross-platform, vendor-neutral scripting language" (http://www.ecma-international.org/memento/TC39.htm). by fromNetscape,Sun, Microsoft,Borlandand other programmers who are interested in scriptingTC39temper out of theECMA-262, the standard defines what is called aECMAScript's new scripting language.

Although Netscape has developed JavaScript was first submitted to the ECMA standardization, but because of the plan to rewrite the entire browser engine, Netscape had a whole year late to launch the "fully follow the ECMA Specification" JavaScript1.3 . and Microsoft introduced the IE4.0 of "fully following the ECMA Specification" a year ago. This leads to a direct consequence:JScript becomes the de facto standard for JavaScript language.

in the next few years, the International Organization for Standardization and the IEC ( ISO/IEC) also adopts ECMAScript as the standard (iso/iec-16262). Since then,Web browsers have struggled (albeit with varying degrees of success and failure) to ECMAScript as JavaScript The basis for implementation.

The fact that JScript becomes the JavaScript language, plus that Windows is bound to IE , Almost all of the market share, soafter1999 years, all the pages were developed based on JScript . and javascript1.x turned into a poor compatible person.

Netscape in the strong offensive of Microsoft,1998 years of comprehensive rout. But a single spark can be a prairie fire. The same year the Mozilla Project was set up in Firefox to support JavaScript incomparable, in the later time step by step nibble IE market, becoming the world's second largest browser.

Google Chrome, also known as Google Browser, is an Open source web browser developed by Google Inc. He is the third largest browser in the world, with a simple page and fast browsing. With the popularity of mobile internet, embedded Android system of tablets and smartphones, in the browser this piece will do a grand.

SafariBrowser is the default browser for various Apple products, in Apple's all-in-one machine(IMAC), Notebooks(MAC),MP4 (ipod),iphone (smart Phones),ipad (Tablet PC), and inWindowsand theLinuxThe platform has a corresponding version. The current market share of the world's four, but with Apple's products continue to deeply rooted, with the trend of hegemony.

Opera 's global market share,2% , is around five. There is no big company behind it, but its survival from "browser wars" has great potential.

Four JavaScript Core

Although JavaScript and ECMAScript are often used to express the same meaning, but JavaScript has more meaning than there is much more to be stipulated in the ECMA-262. A complete JavaScript should consist of the following three different parts.

1. Core (ECMAScript)

2. Document Object Model (DOM)

3. Browser Object Model (BOM)

ECMAScript Introduction

from ecmascript-262 definition of ecmascript and web browsers have no dependencies. ecmascript The basis of this language is defined, and a more complete scripting language can be built on top of that. Our common web The browser is just ecmascript One of the possible hosting environments.

since he is not dependent on Web Browser, what environment is he still lodging in? For example:ActionScript,scriptease , and so on. And his components are: grammar, type, statements, keywords, reserved words, operators, objects and so on.

ECMAScript version

ECMAScript currently has four versions,1,2,3,4, 5 version, which can be searched for lookup.

Web Browser support for ECMAScript

by the year, the five major mainstream browsers (IE,Firefox,Safari, Chrome,Opera) are all compatible with ECMA-262 . Of these, only Firefox strives to be compatible with version 4 of the standard .

Document Object Model (DOM)

Document Object Model (DOM,Document Object Model) is for XML However, it has been extended to HTML the application programming interface (API,application programming Interface) .

DOM has three levels, and each level adds a lot of content modules and standards ( interested in searching for queries ).

Browser Object Model (BOM)

Browser object model for accessing and manipulating browser windows (BOM,Browser Object Model) . Developers use the BOM to control the browser's display of parts other than the page. where the BOM is really different ( and where it often causes problems ), or is it part of the JavaScript implementation still has no relevant standards.

JavaScript (Introduction)

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.