Creation at Netscape
The Mosaic web browser was released in 1993. As the first browser with a graphical user interface accessible to non-technical people, it played a prominent role in the rapid growth of the nascent World Wide Web. The lead developers of Mosaic then founded the Netscape corporation, which released a more polished browser, Netscape Navigator, in 1994. Navigator quickly became the most used browser.
During these formative years of the Web, web pages could only be static, lacking the capability for dynamic behavior after the page was loaded in the browser. There was a desire in the burgeoning web development scene to remove this limitation, so in 1995, Netscape decided to add a scripting language to Navigator. They pursued two routes to achieve this: collaborating with Sun Microsystems to embed the Java programming language, while also hiring Brendan Eich to embed the Scheme language.
Adoption by Microsoft
JScript was first released in 1996, alongside initial support for CSS and extensions to HTML. Each of these implementations was noticeably different from their counterparts in Navigator. These differences made it difficult for developers to make their websites work well in both browsers, leading to widespread use of "best viewed in Netscape" and "best viewed in Internet Explorer" logos for several years.
The rise of JScript
The standards process continued for a few years, with the release of ECMAScript 2 in June 1998 and ECMAScript 3 in December 1999. Work on ECMAScript 4 began in 2000.
Meanwhile, Microsoft gained an increasingly dominant position in the browser market. By the early 2000s, Internet Explorer's market share reached 95%. This meant that JScript became the de facto standard for client-side scripting on the Web.
Microsoft initially participated in the standards process and implemented some proposals in its JScript language, but eventually it stopped collaborating on ECMA work. Thus ECMAScript 4 was mothballed.
Growth and standardization
Examples of scripted behavior
- Loading new page content without reloading the page. For example, social media websites use Ajax so that users can post new messages without leaving the page.
- Animation of page elements, such as fading them in and out, resizing, and moving them.
- Interactive content, such as games and video.
- Validating input values of a web form to make sure that they are acceptable before being submitted to the server.
- Transmitting information about the user's behavior for analytics, ad tracking, and personalization.
The following features are common to all conforming ECMAScript implementations, unless explicitly specified otherwise.
Imperative and structured
- The binary + operator casts both operands to a string unless both operands are numbers. This is because the addition operator doubles as a concatenation operator
- The binary - operator always casts both operands to a number
- Both unary operators (+, -) always cast the operand to a number