New Technologies and What They Mean To You: Part 1
In the often confusing world of the web we hear new acronyms tossed around all the time. In this series of articles Jeremy will attempt to demistify some of the most common web related acronyms.
New Technologies and What They Mean To You: Part 1 - JavaScript (Page 4 of 5 )
Definition (with help from dictionary.com) (Formerly LiveScript) Netscape's simple, cross-platform, World-Wide Web scripting language. JavaScript is an interpreted scripting language developed to extend the functionality of webpages and to provide a certain amount of interaction with the website's users. Structured much like many "Application Languages" in terms of functions, properties, methods, etc, JavaScript lent the web it's first level of "programming", even though it isn't a programming language.
JavaScript relies on C-based syntax which looks much like:
Function funcName(param1,param2) { statement1; statement2; }
JavaScript can be included on a web page in one of 3 ways: externally, in-page and in-line. Externally means you have one JavaScript file which you can call from any of your webpages like so:
Including your JavaScript in-page is often done in the HEAD of your document, and allows any part of that page to access the JavaScript functions, methods and properties, and it looks like this:
<script language="javascript"> function someFunc() { window.alert('hello world!'); } </script>
Including your JavaScript in-line is often the perfect solution for problems which only need solving once, such as letting a user know a certain piece of helpful information when they click on a link:
<a href="javascript:window.alert('This is a helpful hint!');">?</a>
What It Really Is JavaScript is a scripting language that allows you to add interactivity to your web page. If you have ever seen a Clock on a page, a scrolling status bar, seen a new window open or had a web-form tell you some information wasn't filled in properly you have already seen JavaScript.
In the beginning, JavaScript was used mainly for "toys" like telling the user how long they had been on the page. Increasingly though it is developing a place as an essential part of any web-guru's toolkit. From the simple things like form validation to the complex things like drop-down menus and the like, JavaScript is showing that it has matured beyond the toy stage. In fact, you would be hard-pressed to find a large site which didn't utilise JavaScript in some respect.
Advantages
The ability to present information to users as and when it is pertinent
The ability to add interactivity
The ability to utilise the space on your pages more effectively
Disadvantages
The ability to present information to users as and when it is pertinent
The ability to add interactivity
The ability to utilise the space on your pages more effectively
<script language="javascript"> window.alert('You have selected an invalid option'); </script>
Similar Technologies Though there are similar technologies in terms of style and even function (ECMAScript, JScript, etc) JavaScript stands above the pack as the one which is most tightly integrated into the pack.