Powered By Blogger

Monday, 10 January 2011

The Beginning of Javascript

Javascript Intro

Javascript is a misunderstood language. The language is the most used language in the world as well as being a complete language. The language only happens in the browser when the page opens and some Javascript code is written for the page.

An introduction with Douglas Crockford from Yahoo fully explains the life cycle of Javascript, it beginnings and how it is still unfinished with its own set of problems.

You can watch the video here

The video goes on to discuss the different objects, strings, data types and values of variables that are defined in the language and undefined. The language is loosely typed and cannot be changed once the variables have been defined.

Javascript is all about objects the style being the dynamic object.

Please watch the video it is very interesting if you are thinking of learning Javascript.

Here is an example of a program in javascript that adds 2 + 2.

  • The function has a name: addition
  • a is assigned to the number 2
  • The alert is a function that opens a little window when the page loads and displays the data from the addition function
  • a += 2 : means a plus a and the answer,so it is like saying 2 + 2 =
  • The body tag has the function inside ready to execute the function when the page loads.
  • A little paragraph tag displaying some text just in case the Javascript didn't work.