[darren]
[tarrant]
it's my name
Javascript
Introduction
JavaScript, as opposed to PHP, is a client side web scripting language. This means it is installed with the browser onto your PC and is accessed by the code within the page after it arrives on your PC screen. Similar to PHP, however it is a weakly typed language. This means that it essentially does not mind which data type a variable is until it is used and will be automatically converted at time of use. This does require less effort for programmers, but can cause potential problems with bugs or unexpected results if this is overlooked.
Naming
JavaScript was designed to have a similar look to Java, however, despite the similar name it is more closely associated with the C programming language. Both Java and JavaScript have origins with C. Javascript was originally named Livescript and was so dubbed by a collaboration between Netscape and Sun. It was originally developed by Brendan Eich working at Netscape, under the name Livescript. It was changed to be called Javascript at roughly the same time as Netscape introduced support for Java within it's browser in December 1995. At around this time, Microsoft released a variant competitor named Jscript with improved support for Y2K compliance.
Dynamic Programming
As aforementioned Javascript is a weakly typed language. It is also dynamically typed, which means any variable can be assigned to hold any data type and can then be used to contain a different one later in the same script. It is an object oriented language, which means that it follows the class > object > method > property hierarchy as in PHP and these properties or functions can be accessed on a particular object using the dot method notation. Javascript. Because Javascript is client side, it can respond to user actions instantly without posting anything back to the server. Typical uses of Javascript are user driven events, such as a pop up window a mouse over event or to validate entries into a form. However, with the advent of AJAX (Asynchronous Javascript And XML), Javascript can now be used to pass information to and from the server without the page refreshing, delivering dynamic and responsive results.
Cross browser compatibility
An often encountered weakness of Javascript is the behaviour across different browsers. Because it is a client side scripting language, the behaviour of the script depends greatly on the browser environment in which it sits. Often programmers have to implement differing code depending on the browser host it detects. This is increasingly the case with mobile or PDA devices which cannot always run Javascript. Many browsers today have built in error message consoles for Javascript debugging
Other uses of Javascript
Javascript is used in many other environments apart from web browsers, including:
- Actionscript - usesthe ECMAScript standard
- MAC OSX - dashboard widgets
- Firefox and Mozilla - uses Javascript for it Graphical User Interfaces (GUI)
- Adobe Acrobat - support for Javascript in PDF's
- Java SDK - includes support for Javascript
Submit a comment about this page
I am available for freelance web design work in the Cambridge, UK area, outside normal working hours. If you are interested, please