This FAQ has been taken from http://www.intranetjournal.com/faq/js-faq.shtml with the permission of the editor.
For more details visit Intranet Journal at
http://idm.internet.com/index.html
http://www.intranetjournal.com/faq/js-faq.shtml
1. General
2. What versions of the language does this FAQ cover?
5. Can I mirror or reprint this FAQ?
2. JavaScript Documentation
1. Where can I find online documentation for JavaScript?
2. Where is the official bug list for JavaScript?
3. Read any good JavaScript books lately?
3. First Principles
1. What are the language’s basic entities?
2. How does JavaScript model the world? (Nifty Object Map.)
3. What are JavaScript event handlers?
4. How is JavaScript syntax like C / C++?
4. How do I …
1. … embed JavaScript in a web page?
2. … use ‘var’ to make a variable name local?
3. … use quotation marks when scripting?
6. … script a calendar on the fly?
7. … access objects and scripts in windows opened with window.open()?
8. … use JavaScript to password-protect my Web site?
9. … write browser-independent scripts?
10. … match text patterns like I can in Perl?
11. … prevent others from seeing/copying my scripts?
12. … detect whether JavaScript support has been disabled?
5. Troubleshooting
2. Where can scripts go wrong?
3. What are the most common scripting mistakes?
6. Portability
6. Programming Tools
1. What tools are available for developing JavaScript pages?
2. Borland IntraBuilderTM
3. Netscape Visual JavaScript 1.0
2. Are there any debugging tools for JavaScript?
General
1. What is JavaScript?
JavaScript is a platform-independent, event-driven, interpreted programming language developed by Netscape Communications Corp. and Sun Microsystems. Originally called LiveScript (and still called LiveWireTM by Netscape in its compiled, server-side incarnation), JavaScript is affiliated with Sun’s object-oriented programming language JavaTM primarily as a marketing convenience. They interoperate well but are technically, functionally and behaviorally very different.
JavaScript is useful for adding interactivity to the World Wide Web because scripts can be embedded in HTML files (i.e., web pages) simply by enclosing code in a <SCRIPT> </SCRIPT> tag pair. All modern browsers can interpret JavaScript — albeit with some irritating caveats. (More about them below.)
In practice, JavaScript is a fairly universal extension to HTML that can enhance the user experience through event handling and client-side execution, while extending a web developer’s control over the client’s browser. And that’s worth a FAQ.
2. What versions of the language does this FAQ cover?
This FAQ covers the language through JavaScript 1.2, the version deployed in Netscape Communicator 4.0x, plus some compatibility items with Jscript as implemented in Microsoft Internet Explorer 3.0x. The focus here is on client-side JavaScript.
3. What’s not covered here?
Other browser-based scripting languages such as Microsoft VBScript. Server-side JavaScript and Netscape LiveWire Pro. Database connectivity. Known bugs. Netscape’s JSRef source libraries for embedding the JavaScript interpreter in third-party code.
4. Who wrote this FAQ?
The answers herein have been compiled from several sources. The largest contribution is from Danny Goodman’s JavaScript Mini-FAQ, updated periodically in the newsgroup comp.lang.javascript. Postings to that newsgroup are also a rich source of questions and answers. Items quoted or paraphrased from books on the subject are attributed in the text. Finally, we at IDM have added our own two cents worth.
5. Can I mirror or reprint this FAQ?
Yes, with two restrictions. You must retain the previous paragraph (”Who wrote this FAQ?”), and you must cite Intranet Journal, giving the URL in print media and/or linking idm.internet.com in online media.
JavaScript Documentation
1. Where can I find online documentation for JavaScript?
ECMAScript (ECMA-262) has since June 1997 been the official scripting standard for the Web. It is documented at:
http://www.ecma.ch/stand/ecma-262.htm
Current JavaScript docs (for Netscape) are available at:
home.netscape.com/eng/mozilla/3.0/handbook/javascript
Netscape’s JavaScript FAQ is at:
developer.netscape.com/support/faqs/champions/javascript.html
A zipped set of Netscape’s HTML documents is available at:
developer.netscape.com/library/documentation/jshtm.zip
Microsoft’s scripting language site is:
http://msdn.microsoft.com/scripting/
2. Where is the official bug list for JavaScript?
Netscape maintains a page of JavaScript Known Bugs in its online Navigator Release Notes. Unfortunately, according to guru Danny Goodman, “this list is not complete,” and we know of no definitive, well-maintained alternative.
3. Read any good JavaScript books lately?
Yes! As with computer books generally, texts on browser scripting are plentiful, but the number of good ones is surprisingly small. Nor are the best ones always the most visible. Intranet Journal’s favorites, for instance, include a pair of texts from British publisher Wrox Press Ltd.:
-
- Instant Netscape Dynamic HTML Programmer’s Reference (Wrox Press, Aug 1997) by Alex Homer & Chris Ullman
- Instant IE4 Dynamic HTML Programmer’s Reference (Wrox Press, July 1997) by Alex Homer & Chris Ullman
These programmer’s references are so good because they work from the browser object model up, recognizing fundamental differences between the Microsoft and Netscape approaches. As the titles suggest, they treat the gamut of client-side techniques for making web pages dynamic: JavaScript, VBScript, Layers and Style Sheets. They excel as references for each.
The Wrox books are written for a programming audience. Also in this category, but with different emphases, are the following:
-
- Dynamic HTML: The Definitive Reference (O’Reilly, July 1998) by Danny Goodman. A compendium for Web content developers that contains reference material for all of the HTML tags, CSS style attributes, browser document objects, and JavaScript objects.
- Netscape ONE Developer’s Guide (Sams Publishing, April 1997) by William Robert Stanek & Blake Benet Hall. This programmer’s guide to developing commercial-grade Web sites for the Netscape 2.x environment covers client- and server-side scripting in detail.
- JavaScript: The Definitive Guide (O’Reilly, June 1998), by David Flanagan. One of O’Reilly’s Nutshell Handbooks, this guide furthers a tradition that includes Larry Wall’s Programming Perl and definitive texts on every Unix utility. But why a rhino?
Beginners and less technical webmasters may find one of the following sources a more suitable introduction to scripting.
-
- Practical Javascript Programming (M&T Books, March 1997), by Reaz Hoque. Contains extensive plug & play code samples, plus an introduction to Netscape’s server-side language, LiveWire Pro.
- JavaScript Bible, 3rd Ed. (IDG Books, March 1998), by Danny Goodman.
- JavaScript Sourcebook (John Wiley & Sons, Aug 1996), by Gordon McComb.
- Programming JavaScript for Netscape 2.0 (New Riders, 1996), by Tim Ritchey. Older, rich in background, emphasizes JavaScript as stepping stone to Java.
First Principles
1. What are the language’s basic entities?
A. As in most object-oriented, event-driven programming languages, there are four distinct entities in JavaScript:
- OBJECTS. A discussion of objects is beyond the scope of this FAQ (see the section “Objects and the Web” in Intranet Journal’s Intranet FAQ for background). It’s impossible to understand JavaScript without knowing the following essentials, however:
- everything you can control in a web browser is an object comprising properties and methods (sometimes referred to in the literature as attributes and operations, respectively)
- properties define the state of an object; e.g., red text, 10-element array
- methods define the actions that change the state of an object; e.g.,
fontcolor("red")sets the color of a text object to red.
- FUNCTIONS. Methods that operate outside of objects; e.g.,
escape()andunescape(), JavaScript functions that perform ASCII to hex conversions. The existence of non-object-specific functions in JavaScript keeps it from being a truly object-oriented language like Java. - STATEMENTS. Programming commands that control object lifecycles and the flow of execution; e.g.,
if..else,while. JavaScript statements and syntax closely resemble those of the ‘C’ programming language. - EVENTS. Things that happen, usually as a result of user actions, to which a JavaScript program can respond; e.g., a mouse click. Events always happen in relation to a given object, such as a button in a form (for which
onClickis a typical event), or an entire web page (sample event:onLoad). The code that specifies what the object should do in response to an event is a special type of method called an event handler.
2. How does JavaScript model the world?
A. This question goes to the heart of any OOPS [Object-Oriented Programming System]. The abbreviated answer given here — lengthy as it is — omits important differences between the Netscape and Microsoft browser object models, and between various versions of JavaScript. For a more accurate discussion refer to one of the programmer’s references cited elsewhere in this FAQ.
3. What are JavaScript event handlers?
A. Among other things, event handlers are the subject of part II of Intranet Journal’s 3-part tutorial, JavaScript 101, by Reaz Hoque. That’s a good starting place. Also refer to the following diagram from Wrox Press Ltd., which puts browser events and the code that handles them in context.
4. How is JavaScript syntax like C / C++?
A. The languages have enough in common to make learning one easy if you know the other. By the same token, the differences are subtle enough to trip up those proficient in both. Here’s a short list comparing C and JavaScript:
- Terminating JavaScript command lines in semicolons is optional; in C it’s mandatory. Recommended practice is to use them religiously in both languages (and Java as well).
- Both JavaScript and C are case-sensitive; ‘doThis’ is different from ‘DOTHIS’. Experienced programmers learn to love this feature, which drives beginners nuts.
- Both JavaScript and C are block-structured computer languages and employ curly brackets — ‘{’ and ‘}’ — to delimit blocks.
- Both JavaScript and C employ quotation — enclosure in single or double quote marks — to designate text strings.
- Arrays in both JavaScript and C are zero-based; the first element is myArray[0], not myArray[1].
- Both JavaScript and C employ ‘==’ for comparison, ‘=’ for equality, and ‘!’ for negation. In fact the set of JavaScript operators is essentially borrowed from C (right down to the deprecated ternary construct
a ? b : c). - Both JavaScript and C employ the symbols /* to designate a comment */. JavaScript also permits the use of ‘//’ for short comments, as in C++.
Finally, JavaScript’s statements are a strict subset of C++’s, offering a smaller selection of identical looping and conditional constructs.
How do I …
… embed JavaScript in a web page?
Tim Ritchey offers a number of useful style guidelines in his book Programming JavaScript for NetscapeTM 2.0. Here’s how he writes JavaScript:
<SCRIPT LANGUAGE="JavaScript">
<!-- hide script from older browsers
[insert your code here]
// end script hiding -->
</SCRIPT>
Ritchey also points out that JavaScript accepts the C-language comment delimiters /* comment */, useful for multi-line comments.
… use the same variable name several times in a script?
By default all variables in JavaScript are global, meaning they retain their values everywhere in a scripted web page. To make a variable local to a block (such as a function), declare it with the keyword var. Here’s a n example:
// here 'i' is a global counter variable that could, if reused
// elsewhere in this script, create hard-to-find errors
for( i=1; i<=N; i++ ) {
[code to iterate]
}
// to ensure that 'i' exists only in the scope of this
// counter, use var:
for( var i=1; i<=N; i++ ) {
[ ... ]
}
Limiting a variable's scope is especially valuable when cutting-and-pasting an existing script, not necessarily written by you, into a new web page. If you use local variables in your functions, you needn't worry about stepping on variables in t he reused code.
... use quotation marks when scripting?
There are two types of quote mark in JavaScript, the single-quote (') and double-quote ("). Either can be used to delimit a string literal, or sequence of characters. For example:
myDblQString = "This string is surrounded by double-quote marks.";
mySngQString = 'This string is surrounded by single-quote marks.';
However, since HTML itself makes extensive use of double-quotes within tags, it's a good idea to use single-quotes to set off strings in your scripts. This is particularly useful when your code contains quoted elements, as follows:
onClick = "alert( 'Are you sure?' )";
Strings containing apostrophes, which are identical to single-quotes, require you to use the backslash character (\) to escape the apostrophes, as shown below:
myEscString = 'John didn\'t like Mary\'s hat.';
Quoted strings can be combined with other strings, whether literals or variables:
errMsg = "Passwords are case-sensitive.";
message = "Error: " + errMsg;
// assigns 'Error: Passwords are case-sensitive.' to message
... submit forms by e-mail?
The most reliable way is to use straight HTML via a Submit style button. Set the ACTION of the <FORM> to a mailto: URL and the ENCTYPE attribute to "text/plain". For security reasons, the form.submit() method does not submit a form whose ACT ION is a mailto: URL.
Microsoft Internet Explorer 3.0x does not e-mail forms directly, though it can launch an e-mail client such as Eudora Pro or Outlook Express. These in turn convey identifying info to the recipient, offering a measure of security.
... script a visit counter?
At best, a client-side script can show the visitor how many she has been to the site (storing the count in a local cookie). A count of total hits to the server requires a server-side program.
... script a calendar on the fly?
If you view the source of Intranet Journal's Events page, you'll have your answer in freely distributable form. Features of this homegrown implementation include:
object-oriented, with perpetual calendar class
reusable isLeapYear() function
highlights current day
Y2000 compliant
easily invoked from page <BODY> via forms or embedded script commands. Here's a typical invocation:
<SCRIPT LANGUAGE="JavaScript">
<!--
// insert on-the-fly day calendar
makeCal(9, 1997); // September 1997
// -->
</SCRIPT>
To use the code, you'll need to change the part of the getHTML() method demarked "page specific stuff." The code is unsupported and not warranted for any particular use.
... access objects and scripts in the window I open with window.open()?
First, be sure to assign an 'opener' property to the new window if you are using a version of JS that doesn't do it automatically (Navigator 3.0x and MSIE 3.0x do it automatically). The following script should be a part of every new window creation:
var newWind = window.open("xxx","xxx","xxx") // u fill in blanks
if (newWind.opener == null) { // for Nav 2.0x
newWind.opener = self // this creates and sets a new property
}
To access items in the new window from the original window, the 'newWind' variable must not be damaged (by unloading), because it contains the only reference to the other window you can use (the name you assign as the second parameter of open() is not valid for scripted window references; only for TARGET attributes).< /P>
To access a form element property in the new window, use:
newWind.document.formName.elementName.property
From the new window, the 'opener' property is a reference to the original window (or frame, if the window.open() call was made from a frame). To reference a form element in the original window:
opener.document.formName.elementName.property
Finally, if the new window was opened from one frame in the main browser window, and a script in the new window needs access to another frame in the main browser window, use:
opener.parent.otherFrameName.document.formName
... use JavaScript to password-protect my Web site?
There are a number of schemes, but be warned that most fail to deflect the knowledgeable script programmer because no matter how you encode the correct password (e.g., bit shifting), both the encoding algorithms and the result have to be in the script -- whose source code is easily accessible. If you're only interested in keeping out casual visitors, this method may suffice.
A more secure way is to set the password to be the name or pathname of the HTML file on your site that is the 'true' starting page. Set the location to the value entered into the field (unfortunately, you cannot extract the value property of a password object in Navigator 2.0x). Entry of a bogus password yields an 'invalid URL' error.
If the protected pages need additional security (e.g., an infidel has managed to get the complete URL), you might also consider setting a temporary cookie on the password page; then test for the existence of that cookie upon entry to every protected page, and throw the infidel back to the password page.
... write browser-independent scripts?
Strictly speaking, you can’t. Many browsers don't support Javascript at all. We’ve come to think of the Web as a franchise fought over by Netscape and Microsoft, but there are still people who browse with Lynx, NCSA Mosaic, UdiWWW, Cello – well, maybe not Cello. ;^)
Speaking informally, there are two ways to write more portable code. One is to use only least-common-denominator features supported by all versions of Navigator and MSIE. We’re talking JavaScript 1.0, introduced with Netscape 2.0 and IE 3.0. This approach has a couple of drawbacks:
- you lose many of the desirable features available in more recent versions
- the behavior of various browsers differs even at this primitive level, and there are some bugs in JavaScript 1.0.
Your other option is browser-detection. By running a script at load time that identifies the browser it’s executing in, you can branch conditionally to appropriately optimized code. This is good stuff, though it won’t work for all browsers and requires you to add a lot of gobbledy-gook to your web pages.
Here’s a typical browser-detection routine you can customize:
<SCRIPT language="JavaScript">
<!--
function checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,
IEnoPass,OBpass,URL,altURL) {
var newURL = '', version = parseFloat(navigator.appVersion);
if (navigator.appName.indexOf('Netscape') != -1) {
if (version >= NSvers)
{if (NSpass>0) newURL = (NSpass==1)?URL:altURL;}
else
{if (NSnoPass>0) newURL = (NSnoPass==1)?URL:altURL;}
} else if (navigator.appName.indexOf('Microsoft') != -1) {
if (version >= IEvers)
{if (IEpass>0) newURL = (IEpass==1)?URL:altURL;}
else
{if (IEnoPass>0) newURL = (IEnoPass==1)?URL:altURL;}
} else if (OBpass>0) {newURL = (OBpass==1)?URL:altURL};
if (newURL) {
window.location = unescape(newURL);
document.returnValue = false;
}
}
//-->
</SCRIPT>
This code, which should appear in the HEAD section of a web page, jumps to another page if the visitor is using a browser earlier than version 4.0.
... match text patterns like I can in Perl?
The short answer is, "By forgetting about JavaScript and coding server-side CGI scripts in Perl."
A longer, browser-dependent answer: read Angus Young's article, "String matching and replacing in JavaScript 1.2."
... prevent others from seeing/copying my scripts?
You can't. There is no way to produce an HTML document that can be rendered in a browser but whose source cannot be examined in its entirety, scripts included. And since web browsers have functions like "View Source" and "Save As HTML," copying is a cut-and-paste operation.
Putting a copyright notice at the head of your code affords some legal protection.
Microsoft has introduced a technique called script encoding that garbles HTML, ASP, VBS, and JScript source code so that it is unreadable by a casual user. (The lightweight encryption used won't stop determined hackers.) The technique requires Microsoft's version 5.0 Script Engine; it won't execute in Netscape Navigator or earlier MSIE versions.
... detect whether JavaScript support has been disabled?
Common sense says that if you're going to detect if JavaScript is disabled, you'd better do it in something besides JavaScript! Check instead to see if scripting is enabled.
You might, for instance, use something like document.location = 'java_page.html' to redirect the browser to a new, script-laden page. Failure to redirect implies that JavaScript is unavailable, in which case you can either resort to CGI routines or insert appropriate code between the <NOSCRIPT> tags. (NOTE: NOSCRIPT is only available in Netscape Navigator 3.0 and up.)
Troubleshooting
1. What can't JavaScript do?
Quite a bit. Primarily for security reasons, client-side scripting languages like JavaScript cannot:
- read or write random text files on the local disk or on the server
- invoke automatic printing of the current document
- control browser e-mail, news reader, or bookmark windows and menus
- access or modify browser preferences settings
- capture a visitor's e-mail address or IP address
- quietly send me an e-mail when a visitor loads my page
- launch client processes (e.g.,Unix sendmail,Win apps,Mac scripts)
- capture individual keystrokes
- change a document's background .gif after the page has loaded
- change the current browser window size, location, or options
- get rid of that dumb "JavaScript Alert:" line in alert dialogs
Many of these items are possible in Netscape Communicator 4.0, which features the enhanced (and proprietary) version 1.2 of JavaScript. Moreover, those items perceived to be security risks (e.g., access browser settings) require "signed JavaScript."
MSIE JScript v2 (more below) can read/write local files via ActiveX - a source of that architecture's widely publicized security pitfalls.
2. Where can scripts go wrong?
There are three distinct areas where errors can occur in any computer program:
- Load-time errors
- Run-time errors
- Logic errors
Load-time errors
Your script is part of a web page. When someone browses (i.e., requests) that page, your server returns it over the network. On receiving it the requesting browser loads your page: HTML, JavaScript, and any other objects it contains.
Load-time errors are caught by the JavaScript interpreter. As the browser loads your script, it performs myriad checks for basic language problems -- usually syntax errors. If, for instance, you leave off the closing half of a pair of parentheses, the interpreter will tell you about it in the form of a load-time error. Why? Because a script can't run until it has loaded successfully.
By checking your scripts in two browsers -- Netscape Navigator 3.0 (or later) and Microsoft Internet Explorer 3.0 (or later) -- you leverage the language-checking abilities of JavaScript itself to detect load-time errors.
Run-time errors
If your script loads, it will run. It may perform exactly as you designed it to, or it may crash and burn. Like load-time errors, problems at run-time are detected and reported by the JavaScript interpreter. In effect, it says (very quietly): "I loaded that nice-looking script and now it's breaking the rules, corrupting memory and whatnot. I'd better tell somebody." Up pops an alert window to apprise you of the run-time error.
When a program is running it manipulates stored data, operating on values in memory as specified by program commands. Thus, whereas errors occur at load time chiefly due to bad syntax, run-time errors are often due to misuse of the language's commands.
For instance, you'll get a run-time error if at some point your script divides by zero (illegal in any language).
Logic errors
These are the bad guys, problems worthy of the epithet "bugs." Errors loading or running your script are caught by the machine; errors in the logic of you program can only be caught by you or your users -- in other words, humans. When your script runs without complaining but ends up doing the wrong thing, you've got a logic error.
The best way to verify your program logically is to stress it. You probably won't be able to exercise all the possible inputs, outputs, if-then statements and loops, but by hitting a few major ones, you gain confidence that any errors are at least well hidden. If and when these occur, of course, they may be equally hard to trace. But that's software for you.
3. What are the most common scripting mistakes?
In his excellent JavaScript Sourcebook, in a section that begins, "We're only human, after all, and making mistakes is part of our nature," Gordon McComb identifies eleven common JavaScript gaffs:
- Omitting quotation marks in Strings
- Mismatched quotation mark types (' and ")
- Omitting quotation marks when comparing strings
- Confusing '=' (assign) and '==' (compare)
- Improperly nested blocks in IF-THEN-ELSE statements
- Trying to write to the script document
- Trying to access forms as a property of a window rather than a document
- Using String methods with the wrong objects
- Endless loops lock up the browser
- Missing or mismatched '{' or '}' around blocks
- Omitting the return() statement in a function
4. Why won't my script work ...
- ... inside a table?
There is a long-standing bug in JavaScript concerning tables. To be safe, Do not place <SCRIPT> tags inside <TD> tags. Instead, start the <SCRIPT> tag before the <TD> tag, and document.write() the <TD> tag through the </TD> tag. If you're a belt-and-suspenders kind of guy, you can go a step further by using document.write() to create the entire table , interlacing script statements where needed.
- ... under MS Internet Explorer 3 for the Mac?
JScript is available on the Macintosh starting with 3.0.1 (which is different from the Windows 3.01). I am still evaluating the Mac implementation, whose object model and other support for JavaScript does not necessarily jive with the Windows version (e.g., the Mac version supports the Image object for mouse rollovers). MSIE 3.0.1 runs on Mac 68K and PPC. Download it from: http://www.microsoft.com/msdownload/ieplatform/iemac.ht m
- ... under MSIE 3 for Windows 95?
Most language features and objects that are new in Navigator 3.0 are not supported in MSIE 3.0, although several Navigator 3.0 items have been added to JScript version 2 (see below).
- ... when I use document.cookie with MSIE?
It does work, but not when you access the HTML file from your local hard disk, as you are probably doing during testing. Be aware, however, that MSIE limits you to one cookie name=value pair per domain, whereas Netscape allows up to 20 pairs per domain.
5. Jscript Issues
What's new in Microsoft JScript version 2.x and 3.x?
More than can fit here. Some items are compatible with Navigator 3.0+ (such as the Array object). Others are unique to MSIE, such as the Dictionary and TextStream objects (accessible via ActiveX). Additions are to the core language, not the document object model.
New functions let you determine the JScript version installed in IE, but JScript version 2 must be installed to get this data. If you use version 2 or 3.x language features, see www.microsoft.com/JScript for info about including a link button on your page to encourage visitors to upgrade their IE 3.0x to JScript version 2.
How do I know if I have JScript version 2 installed?
Installation of MSIE 3.02 does not guarantee JScript version 2. Search your disk for 'jscript.dll'. Get the file's properties, and click on the Version tab. The File version should begin with '2'. If not, download the latest version from Microsoft (installer is 442KB).
What parts of the JavaScript object model are unsupported in MSIE?
| UNSUPPORTED OBJECTS Image -- this means no onMouseOver swappable images in MSIE 3
Area -- no onMouseOvers Applet FileUpload *Array -- hard-wired (JS1.0) arrays OK; implemented in JScript v.2. MimeType Plugin |
What properties/methods/event handlers are unsupported in MSIE?
| UNSUPPORTED PROPERTIES/METHODS/EVENT HANDLERS OF SUPPORTED OBJECTS Window onerror closed blur() focus() scroll() onBlur= onFocus= Location reload() replace() Document applets[] domain embeds[] images[] URL Link onMouseOut=
Form reset() onReset= All Form Elements type
Navigator mimeTypes[] plugins[] javaEnabled() String prototype split() One more item: the |
6. Portability
- Anyone have a comparison of MS JScript versus Netscape's JavaScript?
Mark Stone wrote the book on it:
http://www.kudonet.com/~markst/jscript/jsdiff.htm
- I thought JavaScript was turned over to the IETF for some sort of standardization. What's happening with this?
Actually it was "turned over" to ECMA, the European Computing Machine Association. They appear to be go-slow, secretive types. It remains to be seen whether this is a serious standardization effort, or a marketing ruse by Netscape to match Microsoft's dubious "turning over" of ActiveX to the X/Open Group.
Programming Tools
1. What is NetObjects ScriptBuilderTM?
A scripting development aid from NetObjects, Inc. In addition to JavaScript, ScriptBuilder facilitates code writing in VBScript, LotusScript and Microsoft ASP. Reviewed by IDM in June 1998.
2. What is Borland IntraBuilderTM?
IntraBuilder is a web application development tool from Inprise Corporation (formerly Borland International) that makes heavy use of JavaScript. Together with companion products C++Builder and JBuilder, IntraBuilder is part of the product line that implements Inprise's "Golden Gate" strategy for web-based client/server development.
Each product in this line targets three developer levels with Standard, Professional and Client/Server editions, corresponding respectively to low ($99), medium ($499) and high ($1999) price points. The increments buy enhanced database connectivity and features for managing team development.
IntraBuilder consists of two primary components:
IntraBuilder Designer, a visual RAD environment for JavaScript that creates Forms -- used for entering, displaying and manipulating data; and Reports -- used for displaying data in a list format that can include groupings and aggregate functions, such as totals or averages. Significantly for readers of this FAQ, IntraBuilder provides wizards that coach the developer through web page specification, then automatically generates standard JavaScript, including form elements and data validation routines.
IntraBuilder Server, which extends basic web server functionality to deliver data-driven pages. IntraBuilder Server uses three primary architectural components (diagrammed below): IntraBuilder Broker, IntraBuilder Agents, and the Borland Database Engine (BDE).
The IntraBuilder Broker automatically provides the communications layer between the IntraBuilder Agents and the Web server, the first layer of state management, and intelligent routing.
IntraBuilder Agents automatically parse forms and reports, dynamically generate HTML, participate in state management, and manage data access and formatting.
The Borland Database Engine provides the database connectivity for IntraBuilder, connecting to a wide range of servers using native APIs and ODBC.
IntraBuilder belongs to a large, maturing class of web-to-database application development tools, several of which are listed in Intranet Journal's Gateways to Data section. IntraBuilder is specifically treated in this JavaScript FAQ because of the central role JavaScript plays in its design.
3. What is Netscape Visual JavaScript?
"A visual tool for rapid crossware development," according to its maker. Netscape defines crossware as "on-demand software that runs across networks, operating systems, and platforms and easily extends to partners and customers."
IDM has experimented with Preview Release 3 of Visual JavaScript 1.0. Functionally impressive, the product strikes us primarily as a weapon in Netscape's anti-Microsoft agenda, for three reasons:
-
- Visual JavaScript's emphasis on crossware and platform-independence directly oppose Microsoft's more vertical, Windows-based architecture
- Visual JavaScript's GUI does not conform to Microsoft Windows style guidelines, despite being launched on Windows. Instead, the product appears to emulate the Unix/Motif look and feel of Sun Microsoystems' Java Workshop
- multi-platform rhetoric notwithstanding, Visual JavaScript is tailored to interoperate primarily with services from Netscape’s SuiteSpot line of servers. Using a built-in component, for instance, you could call upon Netscape Messaging Server to send mail, or Netscape Directory Server to do an LDAP directory query. Microsoft's products in general -- and ActiveX components in particular -- are conspicuously absent from this message.
Lack of support for Microsoft technologies contrasts with Visual JavaScript's otherwise very impressive feature set, which lets developers:
-
- Author HTML with a built-in WYSIWYG Page Builder
- Drag and drop components onto web pages from the extensible Component Palette, which includes CORBA/IIOP services
- Customize components using Inspector to view and edit properties and events
- Use visual, drag-and-drop programming to connect components
- Debug applications using a built-in JavaScript debugger that lets you set breakpoints and step through code
- Manage projects with multiple developers using Enterprise Server 3.0 content management system, which enables page check-in / check-out, version control, and shared component palettes
- Tie into Oracle, Informix, Sybase, or ODBC databases using the included LiveWire JavaScript components, leveraging the built-in LiveWire Database Service in Enterprise Server 3.0.
- Automatically invoke LiveWire compiler and Application Manager behind the scenes for web applications using server-side JavaScript.
- The bundled Component Developer's Kit lets you write new components in JavaScript or Java (i.e., standard JavaBeans).
For more information, visit Netscape's web site, or better yet, download a trial release of Visual JavaScript and take its measure yourself.
4. Are there any JavaScript Debuggers?
Netscape bundles a debugger with Visual JavaScript.
The Microsoft Script Debugger is a debugging environment that extends any Microsoft ActiveX Scripting host application (for example, Internet Explorer or Internet Information Server).
Other Sources
|
For more details visit Intranet Journal at