Javascript (Js|ECMAScript)

1 - About

Javascript is an HTML client side script.

JavaScript is also known as:

This is the world's most popular programming languages due to its role as the scripting language of the web and is universally used to script web content in browsers.

It was invented by Brendan Eich, co-founder of the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation.

The term “JavaScript” refers often to the ECMA262 (official term ECMAScript), since this term is more widely known.

It is a dynamically typed scripting language but typed version exist also (see Javascript - Static Typing).

JavaScript is most commonly used for client-side scripting in a browser, being used to manipulate Document Object Model (DOM) objects for example. The DOM is not, however, typically provided by the JavaScript engine but instead by the browser.

3 - (Grammar|Syntax)

Javascript syntax is based on the Java and C languages.

One of the key differences is that JavaScript doesn't instantiate object through static classes definition; instead, the instantiation is accomplished by object prototypes.

JavaScript grammar:

4 - Javascript vs Java

JavaScript follows most Java expression syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.

Feature Java Javascript Note
Type Static typing and strong type checking free-form language
Object Model class-based prototype-based The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects.
Instances of Class Object A typical object inherits properties (including methods) from Object.prototype, although these properties may be shadowed (a.k.a. overridden).
Functions Non declarative requirements Functions can be properties of objects, executing as loosely typed methods.

Java is a class-based programming language designed for fast execution and type safety. Java's class-based model means that programs consist exclusively of classes and their methods. Java's class inheritance and strong typing generally require tightly coupled object hierarchies. These requirements make Java programming more complex than JavaScript programming.

5 - Support

5.1 - Cannot be resolved to a type

  • Error : …cannot be resolved to a type
  • Answer : You need to have the class that provides the type in your classpath.

Make sure your code is

<% new MyClass*()*.myMethod() %> instead of <% new MyClass.myMethod() %>

It's a common mistake.

6 - Documentation / Reference

  • Bookmark "Javascript (Js|ECMAScript)" at del.icio.us
  • Bookmark "Javascript (Js|ECMAScript)" at Digg
  • Bookmark "Javascript (Js|ECMAScript)" at Ask
  • Bookmark "Javascript (Js|ECMAScript)" at Google
  • Bookmark "Javascript (Js|ECMAScript)" at StumbleUpon
  • Bookmark "Javascript (Js|ECMAScript)" at Technorati
  • Bookmark "Javascript (Js|ECMAScript)" at Live Bookmarks
  • Bookmark "Javascript (Js|ECMAScript)" at Yahoo! Myweb
  • Bookmark "Javascript (Js|ECMAScript)" at Facebook
  • Bookmark "Javascript (Js|ECMAScript)" at Yahoo! Bookmarks
  • Bookmark "Javascript (Js|ECMAScript)" at Twitter
  • Bookmark "Javascript (Js|ECMAScript)" at myAOL
lang/javascript/javascript.txt · Last modified: 2017/07/08 21:26 by gerardnico