Previous Page TOC Next Page See Page



- 26 -
JavaScript and the Future


While the changes brought about in the JavaScript language following the release of Netscape Navigator 3, and more significantly its LiveConnect capabilities, place JavaScript at the forefront of Web publishing languages, Netscape Communications is not a company that likes to sit back on it's laurels.

In fact, a quick browse through the JavaScript newsgroup at snews://secnews.netscape.com/netscape.devs-javascript reveals that plans are already underway for JavaScript enhancements in future versions on Netscape Navigator, possibly under the name Netscape Navigator 4.0.

This final chapter takes a look at the future of JavaScript and also explores some other major World Wide Web developments currently underway, by discussing the following topics:


Where Next for JavaScript?


When JavaScript was first released in version 2.0 of Netscape Navigator, it offered a number of useful capabilities. However, for many Web publishers it was the shortcomings of JavaScript that meant JavaScript was often relegated to the level of oddity or toy.

But now, with the addition of capabilities like LiveConnect and Java to JavaScript communications, not to mention the possibilities provided by Server Side JavaScript using LiveWire, JavaScript has moved well and truly into the mainstream. Having said that, however, there are still a number of areas when JavaScript could possibly be enhanced. The following sections explore some of the features that may appear in future releases of JavaScript.

Dynamic Table Updating


The ability to alter the appearance of pictures and images on a Web page without having to reload or redraw the entire page was greeted by the JavaScript community with a considerable amount of excitement, as was the ability to dynamically update the contents of selection lists and pop-up lists on a form.

While these enhancements are certainly of great value, there is at least one other area of Web page development that is ideally suited to the use of dynamic updates. This is the area of tables.

Currently the only way to alter the text contents of a cell within a table is to redraw the entire page or alternatively place all you text within text area fields inside a form. Using the later technique, it's possible to approximate the effect of altering the contents of a single cell, but using such an approach is somewhat clumsy.

By far the most effective approach to this task is to enable the contents and appearance of each cell to be altered programatically under JavaScript control. Not only the contents of the cell can be altered by using such an approach, but other items such as the new Cell background color attribute might be altered as well.

Disabled Objects


Programmers and other users familiar with windows-like environments will no doubt have encountered fields, buttons, and other elements in different programs which from time to time take on a grayed-out, or disabled appearance, preventing the user from entering information into the field or selecting the button or item.

In the original JavaScript documentation produced by Netscape Communications for Navigator 2.0, a disable() method was proposed for all form objects that would have allowed input fields on a Web page to be enabled or disabled under program control. Unfortunately, due to the various priorities placed on the JavaScript development team, this feature isn't yet available.

There are, however, strong indications that either a disable()/enable() method combination or possibly a .enabled property will finally make the cut for the next release of JavaScript.

Debuggers and Integrated Development Environments


As a programming language that operates by embedding code into existing HTML documents, there are a few unique developmental issues that still need to be resolved by Netscape Communications.

Debugging Tools

The first of these is the lack of any real debugging tools for Client JavaScript. Readers familiar with other high level programming languages such as C++ and even more recently Java will be aware that when trying to track down errors or other problems in a piece of running code, the best approach is to use some sort of debugging tool. Such tools enable you to step through a block of code line-by-line and test the contents of variables and properties at each stage of the code's execution.

At this stage, however, no such debugging tools are being provided by Netscape Communications for JavaScript. Having said this, there are currently at least two major third-party tools being developed, and both go at least part of the way towards resolving this situation.

The first of these is the MLI Technology JavaScript Debugger, shown in Figure 26.1. It can be used to inspect the contents of objects and variables in a running JavaScript-aware Web document. To learn more about MLI's debugger, point your Web browser to http://www.media.com/users/public/jsdb.html.

Figure 26.1. The MLI Technology JavaScript Debugger.

The second is the JSInspector debugging tool, shown in Figure 26.2. Like the MLI tool, JSInspector also enables you to investigate the contents of a JavaScript-aware web page. However, at the time of this writing there were some unresolved problems between JSInspector and Navigator 3 which made JSInspector's use somewhat problematic. These problems will probably be resolved before the final release of 3. You can explore JSInspector for yourself at http://www.anaya.es/I-D/debug/JSInspector.html.

Figure 26.2. The JSInspector debugging tool.



Note:

While the two tools mentioned above go part of the way towards providing debugging tools for JavaScript, as things stand currently there's a need for Netscape Communications to do some additional work in this area itself.


Netscape has made some initial steps towards this with the development of LiveWire, which provides some debugging tools for client-server applications deployed using LiveWire and a Netscape Web server.

Using the debug() function in server JavaScript and the trace facilities provided by LiveWire's Application Manager, limited debugging functionality is possible, although this still isn't a complete debugging solution.

Integrated Development Tools

Programmers who have worked with languages like Visual Basic, Visual C++, or even the Symantec Café environment for Java (see Figure 26.3) will no doubt be aware of the benefits of using an Integrated Development Environment (IDE) that enables a programmer to edit and execute applications using a single development tool.

Figure 26.3. Symantec Café for Java.

Currently, Netscape Communications provides at least part of the benefits of an IDE through Netscape Gold 3 (see Figure 26.4). Using Netscape Gold, you can enter your JavaScript code directly into a Web page along with the HTML code for the page, then test it immediately using the integrated Web browser. Unfortunately, as mentioned previously, there's no way to debug the JavaScript program itself once you have the code written.

Figure 26.4. Netscape Gold 3 enables you to enter your JavaScript code directly into a Web page.

Customizing with LiveConnect


As you discovered in Part 4, "Java and Live Objects," by using Netscape's LiveConnect technology you can create JavaScript code that communicates directly with both Java applets and Netscape plug-ins.

What was not discussed in any great depth at that time, however, is the fact that in addition to working with the LiveConnect ready plug-ins that come bundled with Netscape 3, it's also possible to create your own LiveConnect compatible plug-ins by taking advantage of the LiveConnect Software Developers Kit (SDK) provided by Netscape Communications.

The LiveConnect SDK


To use the LiveConnect SDK you first need to have a reasonable amount of experience working with the C++ programming language, and more particularly, a good knowledge of the development tools appropriate to each of the computer platforms with which you intend to work.

Assuming you have this knowledge, you need to obtain a copy of the LiveConnect SDK for each separate computer platform you want to support. Currently there are SDKs for Windows, Macintosh, and UNIX, all of which can be obtained from http://home.netscape.com/comprod/development_partners/plugin_api/index.html, as shown in Figure 26.5.

Figure 26.5. The LiveConnect SDK contains all the libraries and information you need to create LiveConnect-aware plug-ins.

Each SDK contains all of the runtime libraries and related information you need to create LiveConnect-aware plug-ins. This includes a set of HTML documents that discuss the concept of LiveConnect and plug-ins in detail, as well as examining the development process.



Note:

Even if you don't plan to create your own plug-ins in the future, you may find that a quick read through the documentation included with the SDK is of great assistance in better understanding the relationship between each of the LiveConnect elements—JavaScript, Java, and plug-ins.



Microsoft Internet Explorer 3


Until recently JavaScript was considered by many people to be a peculiarity of the Netscape Navigator. For this reason it was often strongly argued that, as such, it didn't truly deserve to be treated as an integral part of the World Wide Web.

This all changed, however, when Microsoft announced that version 3 of its Internet Explorer Web browser, shown in Figure 26.6, would include native support for both Java and JavaScript. Internet Explorer was discussed in detail in Part Six, "JavaScript and Microsoft Internet Explorer."

Figure 26.6. Microsoft's Internet Explorer 3 Web browser.

In addition to JavaScript support, Internet Explorer 3 (IE 3) also supports many other previously Netscape specific features which were also discussed in Part Six.

This is an important development because it lends impetus to JavaScript and other Netscape-derived features, such as frames, and helps to establish their role as possible standards for the Web, helping Web developers to produce one version of their site that is equally interactive across all, or most, browsers.

This is helped by Microsoft's stated support for standards and their commitment toward pursuing adoption of the features of Internet Explorer in standards controlled by various standards agencies on the Internet.

In addition, Microsoft's implementation of JavaScript as a plug-in scripting language to their ActiveX Scripting engine means that JavaScript can potentially be deployed as the scripting language of choice for applications other than Web browsers that provide ActiveX scripting capabilities.

At the same time as Internet Explorer provides support for JavaScript and Netscape plug-ins, Microsoft has included alternatives to these Netscape features in the form of VBScript—an alternative ActiveX scripting language derived from Visual Basic, and ActiveX controls (or OLE objects).

If Microsoft has its way, VBScript and ActiveX controls will usurp JavaScript and plug-ins as the preferred tools for Web developers. It's too early to say if this will happen and many in the industry are skeptical because Navigator is currently supported on all major computing platforms while Internet Explorer 3 is only available on 32-bit Windows platforms, and there are no clear indications if features such as VBScript and ActiveX support will make it onto other platforms in the foreseeable future.

Netscape ONE


While Microsoft has been making big noises about its commitment to open standards with the release of Internet Explorer 3, Netscape hasn't been quiet.

In the summer of 1996, Netscape introduced Netscape ONE (Open Network Environment) as a network-based development environment based, Netscape says, on public open standards.

Netscape ONE combines several key core technologies, including HTML, Java, JavaScript, LiveConnect, Netscape's Internet Foundation classes—a set of Java classes and APIs that enable deployment of network-oriented applications—and support for a broad range communication, collaboration, and security protocols.

It is Netscape's hope that this environment, if widely adopted, will allow applications to be developed once and then deployed on any platform supporting Netscape ONE and in any environment, from a small self-contained LAN to the Internet.

Netscape ONE comes with a suite of tools including LiveWire, a Software Developer's Kit, and the Netscape Administration kit, enabling the configuration of Navigator for Intranet deployment. In addition, Netscape has begun developing commercial applications that extend Netscape ONE. These include Netscape Wallet, LivePayment, and the Netscape Merchant System.

More detailed information about Netscape ONE is available on Netscape's Web site.

Summary


With JavaScript now in its second major release, it is starting to become a fairly stable and complete language. However, there are still a few areas where work remains to be done. This chapter has examined some of these areas and looked briefly at one of the ways in which JavaScript's capabilities can be expanded by the development of LiveConnect compatible plug-ins.

And finally, to complete the chapter and the book as well, a brief look was taken at the new capabilities of Microsoft's Internet Explorer 3 as well as Netscape ONE, a network development environment from Netscape that includes JavaScript.

Previous Page Page Top TOC Next Page See Page