Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesAdventures in JavaScript


December 1996 / Inbox / Adventures in JavaScript

"JavaScript Adventures" (August) offered a refreshingly real-world approach, but it contained some minor discrepancies, and I found it a bit too critical of Java-Script. First, author Rex Baldazo is correct that the document.clear() method doesn't work consistently in any version of Netscape. However, there is a simple work-around: Use document.open() , which also clears the window, then write the new window's content, then use document.close() to finish the display. He also overlooked a much larger issue, though: Once you use document.open() (or document.clear() , if it worked), the current document -- and hence the currently running script -- disappears. Thus it would not be appropriate for the first example, although it is v ery useful when dealing with multiple windows or frames. Finally, JavaScript's documentation is incomplete and does include some errors, as does the language itself. However, JavaScript is a young language that was still officially beta at the time of your article, so this can be expected to improve. In the meantime, there are Java books that are comprehensive and address the problems.

Michael Moncur
Author, Web Workshop: JavaScript (Sams.net)
mgm@pair.com

The document.open()/document.write()/document.close() work-around is well known. As you point out, though, it overwrites a page and will erase your script unless the script is in one frame and writing to another. If it worked as advertised, document.clear() would let a script manipulate its own page without the risk of destroying itself. While JavaScript may be a young language, Netscape and others have been pushing it as a way to develop real-world Internet and intranet applications. With JavaScript moving to Netscape servers as well, it is vitally important that it be well documented and, more important, that it work as advertised. Sadly, your last observation is also correct: Third-party documentation has often been more useful than Netscape's own. -- Rex Baldazo


Up to the Inbox section contentsGo to previous article: Shrink-Wrapped SoftwareGo to next article: Praiseworthy DistortionSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network