Control the appearance of elements on your web page
Every web page is a collection of several individual elements which are called objects like an image, a link etc.
JavaScript is capable of controlling the appearance of many objects. For example you can open new pages in customized windows where you can specify their size, determine whether they have scroll bars or not etc.
JavaScript responds user actions on your web pages
JavaScript can control objects on web pages in response to various actions taken by the user which is called event. For example display a dialog box when an user clicks on a button, opening a new page, mouse over on a link to change the appearance of the link or control the background color of your web pages.
Display various date time format
JavaScript has the ability to retrieve the date and time of your computer's clock and it is enable to display various formatting of date-time through it's internal date object.
Perform calculations
JavaScript can perform wide variety of mathematical calculations. It has a library of all the mathematical constants and functions needed. These functions can be applied in different ways, for example an online financial transaction where JavaScript can be used to calculate subtotal, total etc, or an online calculator or creating games and interactive simulations with advance math functions such as sine and cosine.
Validate forms data
JavaScript can be used to validate form data including names, addresses, URL, email addresses, phone numbers, zip codes etc. in html forms before sending the data to a server. If you want to validate the said data in server side you have to wait while the information is sent up to the server for checking, using JavaScript you can detect the error and prompt the user immediately.
Create Cookies
A cookie is a mechanism in a web browser where a simple text sent to the visitors' computer. As it is a piece of text, cookies are not executable. JavaSript can store information from this piece of text on visitor's computer and reuse it automatically next time the user visits the same page.
Detect the visitor's browser
Sometimes it is difficult to create pages that are displayed identical on different browsers or even operating systems. JavaScript can detect the visitor's browser and load the appropriate page for that specific browser.
Dynamic HTML
Dynamic HTML, or DHTML, is a collection of technologies used together to make interactive and animated web site by using a combination of JavaScript, HTML, DOM (Document object module) and CSS
photo credit: niecieden. Photo is used under creative Common License.
JavaScript and the ECMA
JavaScript is a cross-platform, object-oriented scripting language developed by Netscape was first used in Netscape browsers. However, Netscape was working with European Computer Manufacturers Association (ECMA) to deliver a standardized, international programming language based on core JavaScript. ECMA is an international standards association for information and communication systems. This standardized version of JavaScript, called ECMAScript, behaves the same way in all applications that support the standard. Companies can use the open standard language to develop their implementation of JavaScript. The first version of the ECMA standard was documented in the ECMA-262 specification. The ECMA-262 standard is also approved by the ISO (International Organization for Standardization) as ISO-16262.
The following table describes the relationship between JavaScript and ECMA versions.
JavaScript version | Relationship to ECMA version |
---|---|
JavaScript 1.1 | ECMA-262 is based on JavaScript 1.1. |
JavaScript 1.2 | ECMA-262 was not complete when JavaScript 1.2 was released. JavaScript 1.2 is not fully compatible with ECMA-262 for the following reasons: Netscape developed additional features in JavaScript 1.2 that were not considered for ECMA-262. ECMA-262 adds two new features: internationalization using Unicode, and uniform behavior across all platforms. Several features of JavaScript 1.2, such as the Date object, were platform-dependent and used platform-specific behavior. |
JavaScript 1.3 | JavaScript 1.3 is fully compatible with ECMA-262. JavaScript 1.3 resolved the inconsistencies that JavaScript 1.2 had with ECMA-262, while keeping all the additional features of JavaScript 1.2 except == and !=, which were changed to conform with ECMA-262. These additional features, including some new features of JavaScript 1.3 that are not part of ECMA, are under consideration for the second version of the ECMA specification. For example, JavaScript 1.2 and 1.3 support regular expressions, which are not included in ECMA-262. The second version of the ECMA specification had not been finalized when JavaScript 1.3 was released. |
JavaScript 1.4 (Works on Netscape server only) | |
JavaScript 1.5 | JavaScript 1.5 is compatible with ECMA-262 Edition 3. This is a major update as per as security and libraries are concern. Better compatibility with modern browser is another important aspect of it. |
JavaScript version and supported browser versions
The following table covers the Javascript versions, release date and supported browser versions.
Version | Release date | Netscape Navigator | Mozilla Firefox | Internet Explorer | Opera | Safari | Google Chrome |
---|---|---|---|---|---|---|---|
1.0 | March 1996 | 2.0 | 3.0 | ||||
1.1 | August 1996 | 3.0 | |||||
1.2 | June 1997 | 4.0-4.05 | |||||
1.3 | October 1998 | 4.06-4.7 | 4.0 | ||||
1.4 | Netscape Server | ||||||
1.5 | November 2000 | 6.0 | 1.0 | 5.5 6.0 7.0 8.0 | 6.0 7.0 8.0 9.0 10.0 | 3.0 3.1 3.2 4.0 | 1.0 |
1.6 | November 2005 | 1.5 | |||||
1.7 | October 2006 | 2.0 | 6 | ||||
1.8 | June 2008 | 3.0 | |||||
1.8.1 | 3.5 | ||||||
1.8.2 | June 22, 2009 | 3.6 |
Test JavaScript Version
The following web document returns the version of Javascript supported by your browser.
HTML Code
- <!DOCTYPE html>
- <head>
- <meta charset="utf-8" />
- <title>JavaScript version checking</title>
- </head>
- <body>
- <h1 style="color: red">JavaScript version checking</h1>
- <hr />
- <script type="text/javascript">
- var jsbrowver = 1.0;
- </script>
- <script language='Javascript1.1'>
- var jsbrowver = 1.1;
- </script>
- <script language='Javascript1.2'>
- var jsbrowver = 1.2;
- </script>
- <script language='Javascript1.3'>
- var jsbrowver = 1.3;
- </script>
- <script language='Javascript1.4'>
- var jsbrowver = 1.4;
- </script>
- <script language='Javascript1.5'>
- var jsbrowver = 1.5;
- </script>
- <script language='Javascript1.6'>
- var jsbrowver = 1.6;
- </script>
- <script language='Javascript1.7'>
- var jsbrowver = 1.7;
- </script>
- <script language='Javascript1.8'>
- var jsbrowver = 1.8;
- </script>
- <script type='text/javascript'>
- alert('Supported Javascript Version : ' + jsbrowver);
- </script>
- </body>
- </html>
photo credit: mattjerome_88. Photo is used under creative Common License.
No comments:
Post a Comment