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".
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, the core programming constructs haven'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, robust programming language that can be used to create programs on all kinds of platforms, while 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 possibly 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 (Flash is used much more for this in modern Web pages).
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 simply identify it as JavaScript, because all modern browsers will recognize JavaScript, but only IE will understand Jscript.
What is JavaScript Summary
- JavaScript is a programming language that is specific to a Web browser.
- JavaScript is an object oriented programming language.
- Almost any element of a browser or Web page can be controlled and manipulated with JavaScript.
- JavaScript has no control over anything but the Web browser, so it is not dangerous, but it can be misused with some annoying results.
- JavaScript was first released as LiveScript, which later got changed to JavaScript.
- JavaScript is not based on Java, and it has nothing at all to do with Java.
- Java can only be embedded into a Web page using an applet.
- Java applets are self contained programs that cannot interact with other elements on the page.
- Microsoft's version of JavaScript is call Jscript. It is almost identical to JavaScript.
Coming Soon:
- Feb 13
- ISSD 24 - XML
- Feb 21
- ISSD 23 - Web 2.0 Technology
- Feb 23
-
Facebook for Business
Hours: 2
Cost: Free!
- Feb 25
-
Search Engine Optimization (SEO)
Hours: 2
Cost: Free!
- Feb 25
-
Search Engine Marketing (SEM)
Hours: 2
Cost: Free!
- Mar 05
- ISSD 23 - Ajax
DHTML - TOC - Introduction - Books -
JavaScript - An Introduction - Links - Questions -
[ 1 ] - 2 - 3 - 4 - 5 -
