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.
One of the first questions many people have is: how is JavaScript related to Java? In fact, some people even confuse the two, since Java does have some limited application online. In reality, JavaScript is kind of like an estranged nephew of Java. While some of the principles, syntax, and functions of JavaScript trace their origins to Java, the two are quite fundamentally different.
Most notably, Java is a full-blown programming language where JavaScript is just a simple scripting language whose only application is online. Java contains an incredible amount of power where JavaScript only has what power it needs to do some cool things on a web page. While it is arguable that simple functions are all that JavaScript requires as an extension of Java to web pages, it is very difficult to compare the two since there is such a wide disparity between their respective abilities.
Java is well known for being an OOP (Object-Oriented Programming) language. JavaScript, on the other hand, mainly utilizes traditional syntax and structures. This is one of the largest differences between the two languages. Because one of the primary identifying features of Java is that it is entirely based on OOP principles, JavaScript is definitely not closely related.
JavaScript, while not being an OOP language, does share some of the OOP principles of Java. For instance, it does deal with properties of certain objects (such as the screen, tags in the HTML code, etc.). These properties are accessed and modified in a similar fashion to how they are in Java.
Oddly, JavaScript is actually much closer to ActionScript than it is to Java. If you develop a small script in either ActionScript or JavaScript, it can often be transferred to the other with a minimum amount of correction and change. This similarity can be very useful, as it is not uncommon for a developer to learn both languages to be able to implement the best solution possible.
JavaScript is also much closer to ActionScript in its native environment than it is to Java. While Java can be implemented on the Internet, it requires a runtime environment to work, just as it does when run locally. While ActionScript does require some software to be installed for the browser to display Flash files (Flash player), this small program is not a runtime environment. JavaScript, of course, does not require any additional installations or software to operate.