Account Log In - Home/Outlines - Books - Contact Us - Support - Employment -

DHTML

JavaScript - An Introduction

What is JavaScript

JavaScript is a browser-specific programming language that uses an object oriented model that is similar in many ways to C and C++. Even though JavaScript is confined to a Web browser, it is still very powerful. Almost any element of the browser and the Web page can be controlled and manipulated with JavaScript.

If you have had any experience with WYSIWYG HTML editors such as Adobe's Dreamweaver, you have probably already used JavaScript. Many of these programs will write JavaScript for you. With Dreamweaver, JavaScript scripts are called "behaviors". While some of the time it may be faster and easier to just have a program like Dreamweaver insert your script for you, it is a good idea not to get too dependant on this. Sometimes you may be required to write a custom script that the WYSIWYG editor just can't do. At times like this, you'll need to know JavaScript. You may also find that some of these editors don't write very clean, efficient code. You will probably find yourself wanting to write your own code instead.

JavaScript is sometimes misunderstood and unfortunately sometimes given a bad rap, causing some people to think they should disable it in their browsers.

JavaScript is not Dangerous

JavaScript definitely has the potential to be misused, but mostly to the extent of being rather annoying. Most people who have accessed the Internet lately have had the lovely experience of out-of-control pop-up windows that seem to take over your screen, with a new one opening as another is closed, or Web pages that won't allow you to use your "back" button to go back to a previous page.

JavaScript itself cannot give your computer a virus, or take over your computer in any way. Other DHML technologies like Microsoft's Active X are much more powerful than JavaScript in this regard. In reality, JavaScript can only control elements of a Web document, and write small files called "cookies" to the user's hard drive in a special "cookies folder".

It is up to you to educate people on the reality that JavaScript is not a bad thing, and is really quite useful.

History of JavaScript

JavaScript made its first appearance in 1995. when Netscape debuted LiveScript. Shortly after, the name was changed to JavaScript, probably as a marketing move to cash in on some of Java's Popularity.

Before JavaScript, programming dynamic content in a Web page could only be accomplished in Java, with everything happening in a square box. These Java programs, called applets, had no way of interacting with other elements on a Web page either.

As time went on, JavaScript went on to become an accepted standard and all the major browsers began to support it. There have been several version changes since JavaScript 1.0, but for the most part, it hasn't changed all that much.

JavaScript VS. Java

One popular myth that still survives to this day is that JavaScript is related to Java. This is completely false. Java is a complete programming language, where JavaScript is a browser-only programming language. JavaScript was not based on Java either. It was based on C and C++ programming languages. The only similarity between the two is that they both have the word "Java" in the name.

As we mentioned above, the marketing people at Netscape probably tried to cash in on the popularity of Java, which was at the time very popular.

Although Java is a very popular programming language, Java can only be embedded into a Web page using applets, and can't interact with anything else on the page. This limits the applet to a single defined area in the Web page. It is commonly used for things like interactive games that require complex programming.

Jscript

Microsoft Internet Explorer has its own version of JavaScript called "Jscript". Jscript is for all intents and purposes, JavaScript. Virtually all of your JavaScript programs will run just fine on Internet Explorer, as it fully supports JavaScript. You never usually hear about Jscript because most people don't need to think about it any more. When identifying a script's language in the Web document (more on this later), you identify it as JavaScript, as both IE and Netscape will recognize JavaScript, but only IE will understand Jscript.

What is JavaScript Summary

Free seminars, open to the public:
Free seminars, open to the public:


DHTML - TOC - Introduction - Books -
JavaScript - An Introduction - Links - Questions - Quiz -
[ 1 ] - 2 - 3 - 4 - 5 -

DHTML - TOC - Introduction - Books -
JavaScript - An Introduction - Links - Questions - Quiz -
[ 1 ] - 2 - 3 - 4 - 5 -