a handy tool
Interactive Elements for Your Web Site
how to use javascript and shockwave

go to:


about javascript
JavaScript may be considered a derivative of the programming language Java. But while both are tools for providing interactivty into web pages, they are as different as bananas and papayas.

Java is a complex programming environment where you create packaged ("compiled") software applications that you can insert into a web page. The learning curve for Java is monumental at best (despite claims of the expanding number of software tools). a toolOn the other hand, JavaScript offers a simpler set of programming instructions that you can enter directly among the HTML formatting of your web pages, and code that can be easily accessed and modified.

Before JavaScript, to create interactive forms (web pages with fields, buttons, and menus) you needed to write computer programs ("CGI" scripts) that resided on and ran from a web server. But with JavaScript, you can perform many form tasks without connecting to a web server. In the jargon, we are processing on the "client-side".

Even better, JavaScript allows you to create content that is dynamic, so that the code inside one web page can produce many different types of displays and features depending on the viewer's actions, including the images that change when you move the mouse over a graphic.

We should note that while JavaScript is much simpler than Java, it is quite a step up from formatting HTML. It might scare you off when you see what JavaScript code looks like! The scripts we will show you are clearly documented, and we will tell you exactly how to alter the contents of the JavaScript code.

JavaScript combined with the absolute screen positioning available in web browsers that support HTML 4.0 provide what is known as Dynamic HTML, or DHTML.

advantages of javascript
As stated above, JavaScript provides interactivity for your web pages without relying on server-side "CGI") programming, which means your pages can be interactive even when you are not connected to the Internet. Since the code is typed directly into your HTML files, you can create Javascript with software as simple as a plain text editor. You can quickly test and modify JavaScript code. JavaScript functionality is built into most newer web browsers since 1996, so there is no extra software for the viewer to download or install.

JavaScript also provides useful commands for testing the viewers capability to view other types of web multimedia (i.e. whether they have Shockwave installed). Although not all web browsers may support JavaScript, there are fairly reliabel methods for you to direct viewers to alternative pages.

Because of its wide use, there are numerous reference sites for learning about JavaScript as well as many sites to download free code that you can use. We'll share a few with you in the next section.

disadvantages of javascript
If you lack experience in programming, JavaScript will look daunting to you. Often, it is not clear how the code works when you examine the HTML source. Long, complicated JavaScripts can add quite a bit of download time to your HTML page.

Although JavaScript is supported on the two major web browsers, there are a few differences that may cause problems. Many of the graphic HTML creation tools do not handle JavaScript very well.

alternatives to javascript
For interactive forms, the only other option is to use server-side programs, or "CGI" scripts. For complex animation, Shockwave and Flash are often better solutions. As time goes by, Java should become more accessible and less clumsy to use and view.

summary for javascript
creation best uses
  • any text editor
  • resides within HTML code
  • client side interactive forms
  • dynamic content for pages
  • opening specific sized web browser windows
  • determining browser features
  • in-page animation
  • navigation menus
advantages disadvantages alternatives
  • interactive forms w/o CGI
  • off-line interactive pages
  • no creation software required
  • fast test and modify cycle
  • built-in feature in modern browsers
  • many free resources
  • more complex than HTML
  • adds file "weight" to HTML files
  • cross-platform issues
  • Shockwave, Flash for animation
  • CGI programming for forms
  • Java, in time

what's next?
With this background, let's look behind the HTML scenes of a JavaScript page. Or go to any other area from our navigation menu.