logo reporter

How We Are Using Netscape Livewire

by Arnold Kling
November, 1996 (updated January 1997)

This is the fifth in a series of monthly essays on the business implications of Internet technology. Feedback on these essays is highly appreciated. The focus of the essays is on how technology can be applied in business. In addition, I like to think about the implications for the stock prices of companies such as Netscape. July's essay discussed Intranets. For an index of my occasional writing on Web technology and business, going back to July 1994, see Business and Economic Issues.

In a previous essay, I suggested that server-side JavaScript is Netscape's secret weapon. We are much of the way through a conversion to Netscape server software, using LiveWire and its server-side JavaScript.

So far, we have used server-side JavaScript as follows:

  1. To take two of our popular calculators, the Relocation Wizard and the Intelligent Mortgage Agent out of the mode of client-side JavaScript. Advantages of moving the programs to the server side are:

  2. To create a common menu that I can put at the bottom of each page, and then change whenever I so choose. To do this, I used the server object in livewire to create an object called server.mymenu (actually, it has a slightly different name). server.mymenu is simply a collection of write statements that produces the menu. When I want to change the menu, I edit the write statements, recompile the file that has server.mymenu, and I've effectively edited every page on my server at once. I usually put the menu at the bottom of the page, but I'll show it here:
    Homebuyers Fair Menu

    Win $1000 off the cost of your move! Enter when you use The Moving Calculator (TM).


    I have a server.heading object as well, which I could edit to "broadcast" important news at the top of every page. It is pretty obtrusive, so I intend to use it sparingly.

  3. To capture browser information when someone makes a comment. When people report bugs, they often turn out to be browser specific. Now, when they use the comment form, I get the request.agent object, so that I see something like "Mozilla 3.0" to indicate Netscape 3.0, or "NetCruiser/V2" to indicate NetCruiser. Very valuable information for debugging purposes.

  4. To tune pages to browsers. For example, visitors to our home page who use Netscape 3.0 or Explorer 3.0 see a spinning ferris wheel. Other browsers are served a static ferris wheel, because they do not deal with moving GIF images very well.

  5. To generate some pages more easily. We have over 100 contact forms on our site from various sponsors. These forms have some elements in common and some elements that vary according to certain parameters. I have a function that is something like formgen(param1, param2, param3) which helps to generate these forms. The page which contains the form calls formgen(...) with the appropriate parameters filled in.
  6. In January, we converted our most popular page, the Salary Calculator, from CGI to server-side JavaScript. This enabled us to add international cities relatively easily. It also seems to run a bit faster.

    Why not Perl? or a Web Wizard?

    Experts in CGI-Perl probably would read the previous section and say, "So what? I can do that already." I would not argue with them. For those experts, the case for using Netscape Livewire/JavaScript may not seem all that compelling.

    There are some experts who believe that CGI-Perl can overload a server by "forking too many processes," but I have not seen that happen. For me, the decision to go with server-side JavaScript instead of CGI-Perl was dictated by the fact that I do not know CGI-Perl, and I think it would be harder to learn than JavaScript.

    There also are proprietary "Web Wizards" of various kinds that can be used with specific server software. For example, both Microsoft FrontPage and O'Reilly's Website have templates that give you the ability to create CGI-like code without your needing to know any programming at all. However, once you get outside of their standard templates (which is the case with our applications), you are stuck.

    Documentation? You want Documentation?

    When client-side JavaScript first came out, it was not documented very well at all. I had to put in a lot of effort just to get simple programs to work. Only after I got hold of Danny Goodman's JavaScript Handbook did I develop any kind of proficiency.

    With LiveWire, I am back in the pre-Danny-Goodman state. The first definitive LiveWire/JavaScript book, when it comes out, will have a really solid explanation of directory mapping, and it will have some genuine application examples, not just code fragments. (January update: The Official Netscape LiveWire Book, by Mark and Julie Richer, was helpful to me. However, it falls a bit short of my hopes for a definitive reference.)

    If poor documentation hampers me, as an application programmer, it can be positively crippling to the poor souls who actually try to set up Netscape servers. If you are one of those, don't come to me with any questions. That is not my department. I am glad that someone else handled that aspect for us.

    Conclusion

    There is a lot of technology that one might evaluate for use in a Web site. What is useful depends on what one is trying to achieve. My focus is on providing the information on The Homebuyer's Fair to the broadest possible audience in a way that is well organized and easy to use. Netscape's LiveWire/JavaScript has allowed me to make some big improvements in a only a few weeks, and once I can find some solid documentation things should be even better.

    (January 1997 update: Electric Press, the company that has done our technical work since we first started in May 1994--before Netscape even had a browser on the market, says that they will be moving away from CGI-Perl and toward Netscape LiveWire in their future work for clients. This is significant. It means that CGI-Perl experts as well as people like me who never learned CGI-Perl both see LiveWire as making it easier to develop applications.)


    This essay may not be reprinted without permission. Comments welcome to arnoldsk@us.net.
    Homebuyers Fair Menu

    Relocating? The easiest way to get competitive rates on the best insurance coverage is with The Insurance Professor