Web Design: Java is an Island

Read at your own risk

This document dates from the early web period, and is kept for archival purposes only. It is no longer updated, and contains much that is apocryphal, or at least wildly inaccurate.
  1. Or What’s an Image For?
  2. Web Design
  3. Style Sheets

There are two types of Java. Java is a programming language designed by Sun Microsystems. They’ve positioned it as an efficient way of transferring computer code over the Internet. Netscape and Internet Explorer support it, however, implementations vary. Advantageously, Java apps can be re-used across different pages, and if a browser either doesn’t understand Java or the reader has turned Java off, you can provide an alternate text or image for that reader to view.

Javascript is a scripting language for web pages, and, at least on Netscape remains buggy. Be aware that putting Javascript in your web pages increases the likelihood that your page will crash some browsers. As well, unfortunately, some sites go overboard on javascripts, causing viewers like me to turn it off. (For example, go to any Geocities site with javascript turned on, and you get a very annoying floating window that won’t go away. Whenever I turn javascript on, it only remains on until the next Geocities site I visit.)

Java and Javascript require relatively modern browsers. Depending on your readership base, there may be many, few, or no Java-compatible browsers hitting your site. Remember that, because you are a developer, you’ve probably purchased a modern computer with lots of memory and hard disk space. Most people don’t live by their computer, however, and don’t spend as much money on them as we do. The majority of your readers could well be sitting there with a 4 or 8 megabyte computer with a 100 or 40 megabyte hard drive! They aren’t going to load Netscape 4 or Internet Explorer 4.

Javascript

There are two ways of using Javascript. The most common is inefficient and deadly. It requires that all of your readers load the script—whether they want to or not. And if they are using browsers that don’t understand Javascript, any non-trivial Javascript is likely to break out and appear, in source code, on your page.

The best way to use javascript is with the “SRC=""” modifier to the <SCRIPT> tag. It allows you to put your javascripts in a separate file, ensuring that they are ignored correctly.

So what’s the choice?

  • Use Sun Java Apps whenever possible. Your Java apps won’t clutter your pages when non-Java browsers hit them. However, Java doesn’t allow you to create interactive web pages; you can only create interactive applications that ride on those web pages.
  • Use Javascript, but use the “SRC=” tag to set your scripts off.
  • Always be aware that users can turn turn these special features off even if their browser supports them. If you have, as alternate text, “this page requires Javascript, please download a browser that supports it”, and they are using a browser that supports it, you just look like an idiot.
  1. Or What’s an Image For?
  2. Web Design
  3. Style Sheets