Under Construction

Javascript® (often shortened to JS) is a lightweight, interpreted, object-oriented programming language with which is interpreted by web browsers (Google Chrome, Internet Explorer, Safari, Firefox, Dolphin...) .

JavaScript can also be used in applications outside web pages--for example in PDF-documents, site-specific browsers and desktop widgets, but it's most common use is in web pages.

It was created by Netscape (now Mozilla) in the late 90's.
It is not related to the Java programming language developed by Sun Microsystems (now Oracle) other than they hold the trademark on the name.

See:
About JavaScript - JavaScript | Mozilla Developer Network (MDN)
Google search for JavaScript

JavaScript is one of the 3 languages all web developers must learn:

  • HTML to define the content of web pages
  • CSS to specify the layout of web pages
  • JavaScript to program the behavior of web pages
The core JavaScript language defines a minimal API (Application Programming Interface) for working with text, arrays, dates, and regular expressions but does not include any input or output functionality. Input and output (as well as more sophisticated features, such as networking, storage and graphics) are the responsibility of the "host environment" within which JavaScript is embedded.

Examples:
React to events on a web page. Examples of events built into browsers
onmouseover, onmousedown, onmouseup, onclick
Bookmarklets
Alerts 

Object-oriented Language:
Javascript is an object-oriented language. The object-oriented programming (OOP) is a programming paradigm uses "objects" - data structures consisting of properties (data fields e.g. color) and methods (program code - something an object can do) together with their interactions.
For example a circle object could have:
properties: x,y coordinates of the center and r -radius
   methods: Area - Calculate the area
            draw - print a circle with the properties in the object
See Introduction to Object-Oriented JavaScript at mozilla.org.
JavaScript Tutorial | w3schools.com

DOM - Document Object Model:

Web pages use HTML (Hypertext Markup Language) to tell browsers how to display the information (text, graphics) and what to do with links or other objects.
Each HTML document loaded into a browser window becomes a Document object. It may contain things like Link Objects, style objects, button objects, form objects, ...
See: JavaScript and HTML DOM Reference at w3schools.com
and JavaScript - W3C DOM - Introduction at QuirkSmode.org

Standards:
Javascript has been standardized by the European Computer Manufacturers Association (ECMA) and is sometimes called ECMAScript.
Most browsers ( Internet Explorer [IE] 5.5 and above, all version of Firefox & crome, Safari 3 and above and opera 6 and above) support the ECMA version 1.5. Microsoft has their own version called JScript.
Firefox 4 supports up to version 1.8.5.
JScript is Microsoft's version which has additional features. See msdn.microsoft.com/en-us/library/hbxc2t98.aspx
See ECMAScript Versions at wikipedia

Libraries:
Many standard javascript functions are available on the internet for download. The most popular one is jQuery, with several books written on it.
jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, interactions for rapid web development. jQuery is designed to change the way that you write JavaScript (jquery.com). There is a free license for non-commercial projects available from MIT or GNU.

JavaScript copies many names and naming conventions from Java, but the two languages are otherwise unrelated and have very different semantics.

Examples:
Simple put output
More complex example (GCD calculation)

Examples

OnMouseOver is a function built into browsers.
When you put your mouse over "onMouseOver" above it will display a comment
at the bottom of your screen.
e.g.
onMouseOver="window.status='MouseOver function';return true;" 
onMouseOut="window.status='';return true;" 

Hide telephone numbers from web crawlers:

<SCRIPT><a href="sms:848-203-4814"><SCRIPT language="JavaScript"><!-- var NPA = "848"; var NXX = "203"; var LINE = "4814"; document.write("(" + NPA + ") " + NXX + "-" + LINE) //--></SCRIPT> Many pages use AJAX (Asynchronous JavaScript and XML), JavaScript's capability to use a built-in object, XMLHttpRequest, to communicate with a server without submitting a form or loading a page.

Development tools:
Debugging software is available as a firefox add-on.
See What is Firebug? : Firebug getfirebug.com


JSON
JavaScript Object Notation (JSON) is a language-independent data format. It derives from JavaScript, but as of 2016, code to generate and parse JSON-format data is available in many programming languages. It uses human-readable text to transmit data objects consisting of attribute-value pairs.
It is the most common data format used for asynchronous browser/server communication (AJAJ), largely replacing XML which is used by AJAX.
JSON Example
{"employees":[
    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}
]}
The following XML example also defines an employees object with 3 employee records:

XML Example
<employees>
    <employee>
        <firstName>John</firstName> <lastName>Doe</lastName>
    </employee>
    <employee>
        <firstName>Anna</firstName> <lastName>Smith</lastName>
    </employee>
    <employee>
        <firstName>Peter</firstName> <lastName>Jones</lastName>
    </employee>
</employees>
Search for JSON
Bookmarklets:
A bookmarklet is an applet, a small computer application, stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. They are frequently JavaScript commands to extend the browser's functionality.
See more about bookmarklets.

Books:
JavaScript: The Definitive Guide: Activate Your Web Pages O'Reilly by David Flanagan
JavaScript, A Beginner's Guide, Third Edition by John Pollock
jQuery Cookbook: Solutions & Examples for jQuery Developers, O'Reilly, by Cody Lindley
Top 10 Best JavaScript Books that Beginners should Read - tripwire magazine
5 JavaScript Books Worth Every Cent

Links:
JavaScript and HTML DOM Reference at w3schools.com
Easy to Style jQuery Drop Down Menu Tutorial | Queness
WebReference.com
  How to Use a JavaScript Query String Parser
  JavaScript and Ajax Tips & Tutorials
JavaScript: The World's Most Misunderstood Programming Language

Is JavaScript an Object Oriented Programming (OOP) Language ?:
There are discussions as to whether JavaScript is an OOP.
Just because a language has objects doesn't make an OOP.
Four specific object properties, abstraction, polymorphism, inheritance, and encapsulation generally define an OOP.
At Is JavaScript object-oriented? - Stack Overflow, AnthonyWJones says JavaScript does provide a fairly easy means to inherit implementation via prototyping but this is at the expense of encapsulation.
At Object-oriented Programming | Eloquent JavaScript, they say JavaScript has a rather eccentric take on OOP.
So it seems JavaScript is not strictly an OOP.

Aza Raskin says at (www.azarask.in/blog/post/making-javascript-syntax-not-suck/),
"While I’ve come to love Javascript, I miss the syntactic beauty of Python. The stark modern minimalism of the language causes the meaning of code to float on the syntax like a feather on water. There are no extra braces, brackets, or parenthesis to saturate your visual bandwidth. In comparison, Javascript’s syntax is like the cluttered boudoir of a Victorian house: elaborate, ornate, and unnecessary. You can be left with half a dozen trailing braces and parenthesis, with no clear owner; their balance in an unstable equilibrium.

Note that I am not arguing that Javascript isn’t a beautiful or powerful language, just that its syntax is a vestigial meme left over from a time when we didn’t know better."

PythonicJavascript (pyScript) (still under development) is an attempt to make it better.

// Pyscript
function triangle(a,b):
  if a > 0 && b > 0:
    function sqroot(x):
      if x > 0:
        return Math.pow(x,.5)
      else:
        return 0
    return sqroot( a*a + b*b )
  else:
    return 0
// Javascript
function triangle(a,b){
  if(a > 0 && b > 0 ){
    function sqroot(x){
      if( x > 0 ){
        return Math.pow(x,.5);
      }
      else {
        return 0;
      }
    }
    return sqroot( a*a + b*b );
  }
  else {
    return 0;
  }
}
Acknowledgement:
Thanks to Evan Willams for advice. See New Holland Press Blog

last updated 19 Mar 2016