Skip to main content.

Web Based Programming Tutorials

Homepage | Forum - Join the forum to discuss anything related to programming! | Programming Resources

Special Edition Using Java Script

Appendix D -- Current Bugs and Future Enhancements

Appendix D

Current Bugs and Future Enhancements


This appendix summarizes some of the current "bugs" in JavaScript that you should be aware of and lists a few of the new features hinted at by Netscape in future releases of Netscape Navigator. By the time you have this book in your hands many of these bugs may indeed be fixed (as well as new ones discovered), but you will be able to gain some insight into why JavaScript behaves as it does in your version.

Bugs in JavaScript

Before addressing the new features targeted for release in Netscape Navigator 2.1 and 3.0, lets look at some of the items that represent current bugs in Netscape's JavaScript. These are presented here to help you avoid hours of head scratching and recoding, only to find out that it's not really your fault. To find out if these have been fixed in your version of Netscape, go to the Release Notes section in Navigator. In Windows, select Release Notes from the Help menu; in Macintosh, select Release Notes from the Balloon Help menu. The following items are a few of the current bugs in Netscape's 2.01 version of JavaScript, and ways to avoid them:

Listing D.1  Long Strings Literals in JavaScript

var thisString="Wow this is a long string of code which will not work in current versions of Netscape! Especially Windows 3.1. Wow this is a long string of code which will not work in current versions of Netscape! Especially Windows 3.1. Wow this is a long string of code which will not work in current versions of Netscape! Especially Windows 3.1. Wow this is a long string of code which will not work in current versions of Netscape! Especially Windows 3.1."

Permanent Limitations

JavaScript has certain limitations built in that most likely will not change over time. These limitations are tied closely with the issues of security. Although JavaScript will execute small "programs" on your machine, you do not want it to send or receive information that you do not explicitly request.

JavaScript will most likely never be able to directly write to a file (although recently a script was developed that allows JavaScript to prompt you to save some data in a file of your choice-much like when you download an unknown file type). It hopefully will not be able to access your personal history files (as in sending them to others). It will not access your e-mail address (again, as in sending it to another site).

Also, it will probably, in the future, check a site against some list you develop (or via some RSA security key) and mark a site as "trusted" or "not trusted" and treat that script accordingly. Scripts from trusted sites will probably have greater freedom to manipulate information for you, as well as perform tasks that untrusted sites would be banned from. There is also a new concept called information tainting that will allow scripts to access more sensitive information from your browser.

New Features in JavaScript

Brendan Eich, the engineer at Netscape in charge of JavaScript, has been working to improve JavaScript with each version of Netscape that is released. Because of time constraints, many features originally targeted for the first release have been delayed. The following section represents some of the features that will be included in future releases of JavaScript.

Netscape Navigator 2.1

Netscape Navigator 2.1 is the next release of the browser to include new features and bug fixes. This release is expected some time in the summer of '96 (as of this writing). This release represents mainly a set of minor changes and improvements over 2.01.

If you read the bug listings earlier in this appendix, you know much about what will be fixed in 2.1. There are a number of items, though, that are not considered bugs, which are also intended to be added to the next version of JavaScript (via the next version of Navigator-since there is no distinction in terms of versioning). The following lists some of these features:

Listing D.2  Client-Side Imagemap-Before JavaScript

<MAP NAME=bottom>

<AREA SHAPE=rect COORDS="0,0, 46,31" HREF=/search/index.html>

<AREA SHAPE=rect COORDS="47,0, 106,31" HREF=/ads/index.html>

<AREA SHAPE=rect COORDS="107,0, 163,31" HREF=/misc/contact_info.html>

<AREA SHAPE=rect COORDS= "164,0, 223,31"


<AREA SHAPE=rect COORDS= "224,0, 285,31" HREF=/toc.html>

<AREA SHAPE=rect COORDS= "286,0, 354,31" HREF=/comprod/mirror/index.html>

<AREA SHAPE=rect COORDS= "355,0, 418,31" HREF=/escapes/galleria.html>

<AREA SHAPE=rect COORDS= "419,0, 468,31" HREF=/feedback/index.html>

<AREA SHAPE=default HREF=/index.html>


Netscape Navigator 3.0

The 3.0 release of Netscape Navigator will include a host of new features in addition to improvements of JavaScript. For instance, it will use Collabra Share, video and audio streaming, Live3D (VRML), and a second generation Java engine. The following is a short listing of the expected changes to JavaScript that have been announced through various channels via the Internet:

Listing D.3  Simple HTML Example



<TITLE>Welcome to my Site!</TITLE>



<H1>Today's Date is July 14, 1996!</H1>

Welcome.....blah blah




Listing D.4  Alternative Code Using JavaScript SRC Attribute



<SCRIPT SRC="mytitle.js"><SCRIPT>



<SCRIPT SRC="todaysdate.js"></SCRIPT>

<SCRIPT SRC="myintromessage.js"></SCRIPT>

<SCRIPT SRC="myaddress.js"></SCRIPT>



Communicating with Other Elements in the Navigator

As with the SRC tag, the JavaScript documentation originally talked about using JavaScript to read and write properties of plug-ins and Java applets from within the JavaScript script. This specification has yet to be completely hashed out, but you will soon be able to see the properties of applets and plug-ins. There will be two new Navigator properties: navigator.plugins (an array of plug-ins that specify all of the currently registered plug-ins) and navigator.mimeTypes (which specify information about all of the MIME types supported by that Navigator). Later there will also be document.plugins, which reflect the information listed in all of the EMBED tags of a given page.

It's expected that you will also have something like navigator.applets that will correspond to the APPLET tag listings. To get or change attributes of these new properties you will use navigator.plugins[0].propertys[0], or something similar.

The Future

JavaScript has a bright future if it can keep up with the rapid pace of change that has been the norm for the past few years in the software and Internet development world. JavaScript is relatively robust and useful, and adds a new dimension of interactivity to the Web. There has been a general trend in the computer industry to pass more work off to the client machine, which now has the processing power to handle it. JavaScript continues this trend by allowing you to avoid using CGIs for many tasks. And with the development of server-side JavaScript, Web sites will probably become more like full blown applications-instead of their current relatively static nature.