|
|
|
Notes from 45th International STC Conference
Anaheim, California, May 17-20, 1998
Jivin' with (Java and) JavaScript
Abstract: Join us for
a demonstration overview of Java and JavaScript: what they are, how they
work, and what they are likely to mean to us as technical communicators.
- No handouts were provided,
but the presenter will make available a wide range of sources online
via e-mail: contact chuckbeck@lucent.com.
- Origin of Java was
Sun Microproducts, 1990...the intent was to design a multiple-platform
operating system that would work virtually anywhere.
- That project died in 1994,
but the proliferation of the Web gave it a second birth. By incorporating
such capability in a browser, the user could run programs that were platform-independent.
- Java was introduced in 1995.
Basically, it's a programming language, based loosely on C++. The idea
was to avoid the need to convert programming to be compatible with several
different operating systems.
- Java runs on top of Java Virtual Machine, which is embedded in the major browsers.
- Sun developed the HotJava
browser to demonstrate the power of Java in a WWW environment; the browser
still exists, although it is not in widespread use.
- The Netscape vs. Microsoft
wars might endanger the platform-independence which is Java's hallmark.
Both browsers are developing their own versions.
- If you use Java, test it
on several different browsers (Netscape 2.0 thru 4.0, Internet Explorer 3.0, etc).
- JavaScript was invented
to make it easier for the non-programmer to use it in Web page design.
It is a "simple, object-oriented, distributed, interpreted, robust,
secure, architecture-neutral, portable, high-performance, multi-threaded,
and dynamic language."
- Javascript requires:
- A Java-capable browser
- An HTML text editor
- A little knowledge
- Key differences between Java and JavaScript
- Java us a full-blown programing language; JavaScript is a limited scripting language.
- Java is relatively difficult to learn; JavaScript is relatively easy to learn.
- Java must be compiled and interpreted; JavaScript needs only to be interpreted.
- Java makes larger files and is slower on the Internet; JavaScript creates smaller files
and is faster.
- Java can run without a browser; JavaScript requires a browser...
it works only in a WWW environment.
- Java Applets are applications designed specifically for the WWW.
- Java Applications
- Clocks
- Ticker tape marquees
- Electronic billboards
- "Smart forms"... JavaScript
lets users check it on their own platforms before sending it back to the server.
- Order forms
- Surveys
- "Guest books"
- Online manuals
- Catalogs
- Customer references
- Sales ads
- Audio: MIDI files, etc.
- Computer-based training
- How to use JavaScript
- The <SCRIPT> tag
plus <LANGUAGE = "JAVASCRIPT"> tells the Java-capable
browser that the script is starting. Then comes the script, followed
by the end-script tag, </SCRIPT>.
- What about "Java-challenged"
workstations? They'll see the actual script language. The solution
is to hide the script and put in an alternate message such as "Go
get a Java-capable browser!" The method is comment tags: <!-->
and <//--> Comment goes between the // and the --.
- JavaScript drives the
"Last Modified" date feature. It automatically updates
the date each time you go in and update the site.
- JavaScript can create
an emulated popup window within HTML. You create a hot link within
the text that energizes the window and opens JavaScript to do its
thing. You must define the width and the height, or the JavaScript
will be infinitesimal on the page. Also, be sure to include a CLOSE
button. The secondary window can be moved on-screen by dragging, just like any window.
- Place a customized version
of JavaScript in the <HEAD> portion of your HTML page code,
and then refer the individual <SCRIPT> tags back to the head.
That creates a defining function which will operate each time it is called upon.
- How to use applets
- <APPLET CODE="name.class" WIDTH=pixels HEIGHT=pixels>
- <PARAM="name1" VALUE="value 1,2...n"> The values govern things like
centering, font, background color, audio, etc.
- Finish with </APPLET>
- Examples of applets
- Moving cursor over a section of the page causes the content to change.
- Online resumés
can exploit JavaScript to spiffy up their appearance, but you need
to have a non-Java version as well, lest your user not have Java capability.
- A key resource: www.gamelan.com
is the official repository for all things Java-related.
- Speculation and observations on the future of Java/JavaScript:
- JavaScript could be
extremely useful for online references, online help, and online
documentation -- IF Netscape and Microsoft can agree on a standard version.
- Will continue to have
a huge impact on those doing Web-based work; it makes no sense to
have one person write and another code.
- Someone is going to
be needed to document Java applications and applets, as they are developed.
- It is helpful, though
not essential, to understand Java code in order to document JavaScript.
- It's important to use
JavaScript judiciously...for functionality, not just as a neat bell and whistle.
- Q & A's
- What about Java HELP? It's in its infancy, but has potential.
- Can you use URLs with the popup windows? Yes.
- Can popup windows be
used intra-file (i.e., putting another link within the text of the popup window) No.
- Can JavaScript be used for an Index or an expandable Table of Contents? Yes.
This offers high potential for usability.
- Can you use a JavaScript
to detect what browser and version the user has? Yes. It can also
trigger a notice to the user advising him/her of the platform limitations.
|