JavaScript is an online scripting language that is implemented and works directly with HTML pages. Similar to Flash and ActionScript, JavaScript brings a dynamic nature to web pages that does not require the page to change. Obviously, this functionality is very useful for a wide variety of reasons. JavaScript can make a developer’s life a lot easier in a lot of ways. On the other hand, the various down sides of implementing JavaScript are significant—sometimes too much so.
The major addition of JavaScript to a web page, as mentioned, is its real-time dynamic capabilities. JavaScript allows a developer to change the content that appears on a page without changing the page itself. If this does not mean much to you, then you can basically think of it as something like a drop-down menu or pop-up “window.”
The real-time nature of JavaScript is what differentiates it from all other dynamic languages online. PHP, for instance, is a much more powerful language that JavaScript. However, (in general) in order for PHP to change content, a page must be refreshed.
PHP is executed before the HTML of a page, and cannot change any content after the HTML has been loaded. This severely limits the application of PHP (and other languages like it) to creating applications that rely upon real-time content changes.
If you are more technically inclined, then you probably already know about HTML and how it is code that drives the appearance of a web page. While PHP can change the code behind the HTML, it can only do it before the user sees it.
JavaScript, on the other hand, is executed at the same time as HTML. This is what allows it to change content on the page after it has been loaded. Just as HTML is always present on the page, JavaScript is always ready to operate as long as the window is open.
One of the only other languages which provides a similar application to JavaScript is CSS. CSS is intended to determine the visual aspects of elements on web pages; it is not truly even a scripting language. However, it does have some abilities to change the appearance of a page after it has been loaded. For instance, it can take advantage of the “rollover” (when the mouse hovers over something) attribute of objects to change appearances of different items as the user is navigating the page. However, because CSS is not a real scripting language, is use for real-time dynamic capabilities is far more limited than JavaScript’s.