JavaScript overview
Learning Essentials:
1. What is JavaScript
2.JavaScript Features
3.JavaScript history
4.JavaScript Core
5. Development tool Set
JavaScript was born in 1995. It was designed to verify the validation of form input. Because the validation of forms is validated by the server side before JavaScript is available. At that time, the telephone dial-up internet age, the server to verify the data is a very painful thing.
After many years of development, JavaScript has become a powerful programming language from a simple input validation. So, learning to use it is very simple, and it takes a long time to really master it. Then this video will lead you into JavaScript classroom, to learn and understand it.
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 + + or java.
Inheritance mechanism
The object-oriented inheritance mechanism in JavaScript is prototype based, much like another self language that is not well known, and is quite different from the inheritance in C + + and Java.
Three JavaScript history
Introduction
Probably in 1992, a company Nombas developed an embedded scripting language called c--(C-minus-minus, or CMM). 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.
Birth
In 1995, Brandon (Brendan Eich), who worked at Netscape (Netscape), was working on a problem similar to "validating before submitting data to the server". Netscape Navigator 2.0 teamed up with Sun to develop a scripting language called LiveScript. For marketing convenience, then renamed JavaScript (the goal is to cool the tree under the Java lesson).
The wicked later
Because JavaScript 1.0 is so successful, Microsoft has also decided to move into the browser, release IE 3.0 and launch a JavaScript clone called JScript (which is named to avoid potential licensing disputes with Netscape). and also provided their own VBScript.
The importance of standards
After Microsoft entered, there were 3 different versions of JavaScript that existed: JavaScript in Netscape Navigator 3.0, JScript in IE, and scriptease in Cenvi. Unlike C and other programming languages, JavaScript does not have a standard to unify its syntax or features, and these 3 different versions highlight the problem. As the industry's fears increase, the standardization of the language is clearly imperative.
ECMA
In 1997, JavaScript 1.1 was submitted as a draft to the European Association of Computer Manufacturers (ECMA). The 39th Technical Committee (TC39) was delegated to "standardize the syntax and semantics of a generic, cross-platform, vendor-neutral scripting language" (http://www.ecma-international.org/memento/TC39.htm). The ECMA-262, made up of programmers from Netscape, Sun, Microsoft, Borland and other companies interested in scripting, defines a new scripting language called ECMAScript.
Agile Microsoft, slow Netscape
Although Netscape developed JavaScript and first submitted it to ECMA standardization, it was a full year since Netscape introduced the JavaScript1.3 "fully follow the ECMA specification" because of plans to rewrite the entire browser engine. 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.
Development of standards
In the next few years, the International Organization for Standardization (ISO/IEC) also adopted ECMAScript as the standard (iso/iec-16262). Since then, web browsers have struggled (albeit with varying degrees of success and failure) to ECMAScript as the basis for JavaScript implementations.
Cottage defeat Original
The fact that JScript becomes the JavaScript language, plus that Windows is tied to IE, is almost total market share, so after 1999 years, all Web pages are developed based on JScript. And javascript1.x turned into a poor compatible person.
The decline of Netscape and the rise of Firefox
Netscape in 1998, under the powerful offensive, the overall rout. But a single spark can be a prairie fire. In the same year, Mozilla Firefox was created as the second-largest browser in the world, with its unparalleled support for JavaScript, which in later time eroded the market of IE.
Google's ambitions
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.
Apple's strategy
The Safari browser is the default browser for Apple's various products, in Apple's all-in-one (IMAC), laptop (MAC), MP4 (ipod), iphone (smartphone), ipad (tablet), and versions on both Windows and Linux platforms. The current market share of the world's four, but with Apple's products continue to deeply rooted, with the trend of hegemony.
Survivors
Opera's global market share is around 2%. There is no big company behind it, but its survival from "browser wars" has great potential.
Four JavaScript core
While JavaScript and ECMAScript are often used to express the same meaning, JavaScript has a much larger meaning than the one set out in 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
The ECMAScript defined by ECMAScript-262 has no dependencies on the Web browser. ECMAScript defines only the basis of this language, and on top of that it builds a more complete scripting language. Our common web browser is just one of the possible hosting environments for ECMAScript implementations.
Since he doesn't rely on a 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, and is no longer discussed in detail here. Interested classmates, can search for access.
Web browser support for ECMAScript
By the year 2008, the five major mainstream browsers (IE, Firefox, Safari, Chrome, Opera) have all been compatible with ECMA-262. Of these, only Firefox strives to be compatible with the 4th edition of the standard. The following is the support table.
Browser |
ECMAScript compatibility |
Netscape Navigator 2 |
---- |
Netscape Navigator 3 |
---- |
Netscape Navigator 4--4.05 |
---- |
Netscape Navigator 4.06--4.79 |
1th Edition |
Netscape 6+ (Mozilla 0.6.0+) |
3rd Edition |
Internet Explorer 3 |
---- |
Internet Explorer 4 |
---- |
Internet Explorer 5 |
1th Edition |
Internet Explorer 5.5--7 |
3rd Edition |
Internet Explorer 8 |
Version 3.1 (not fully compatible) |
Internet Explorer 9 |
5th Edition |
Opera 6-7.1 |
2nd Edition |
Opera 7.2+ |
3rd Edition |
Opera 11+ |
5th Edition |
Safari |
3rd Edition |
Firefox 1--2 |
3rd Edition |
Firefox 3/4/5/6/7/8/9 |
Version 3rd/5 |
Document Object Model (DOM)
The Document Object model (Dom,document object models) is an application programming interface (Api,application programming Interface) for XML but extended for HTML.
Dom has three levels, and each level adds a lot of content modules and standards (interested in searching for queries). Here's what the mainstream browsers support for DOM:
Browser |
DOM compatibility |
Netscape Navigator 1--4.x |
---- |
Netscape Navigator 6+ (Mozilla 0.6.0+) |
Class 1, Level 2 (almost all), Level 3 (partial) |
Internet Explorer 2--4.x |
---- |
Internet Explorer 5 |
Level 1 (minimum) |
Internet Explorer 5.5--7 |
Level 1 (almost all) |
Opera 1--6 |
---- |
Opera 7--8.x |
Level 1 (almost all), Level 2 (partial) |
Opera + |
Class 1, Level 2 (almost all), Level 3 (partial) |
Safari 1.0x |
Level 1 |
Safari |
Level 1, Level 2 (partial) |
Chrome 0.2+ |
Level 1, Level 2 (partial) |
Firefox 1+ |
Class 1, Level 2 (almost all), Level 3 (partial) |
Browser object Model (BOM)
The browser object model that accesses and operates the browser window (bom,browser). 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 as part of the JavaScript implementation, there is still no relevant standard.
JavaScript version
Mozilla, the Netscape "Heir", is currently the only browser developer to use the original JavaScript version number. The last version of JavaScript in the browser is 1.3 when Netscape hands the JavaScript to the Mozilla project. Later, as Mozilla continues to develop, the JavaScript version number gradually increases.
Browser |
JavaScript version |
Netscape Navigator 2 |
1.0 |
Netscape Navigator 3 |
1.1 |
Netscape Navigator 4 |
1.2 |
Netscape Navigator 4.06 |
1.3 |
Netscape 6+ (Mozilla 0.6.0+) |
1.5 |
Firefox 1 |
1.5 |
Firefox 1.5 |
1.6 |
Firefox 2 |
1.7 |
Firefox 3 |
1.8 |
Firefox 3.1+ |
1.9 |
Five Development tools Set
Code Editor: notepad++. (found in 360 software butler, download and install directly)
Browser: Google Chrome, Firefox browser, IE browser, ietest tools and so on.
PS: Learning JavaScript needs a certain foundation, must have XHTML+CSS Foundation, at least a server-side programming language Foundation (such as PHP), an object-oriented technology (such as Java), at least one Web development Project Foundation (such as message board program, etc.).
Section 96th, JavaScript overview