Learn how to create Navigator 4 Object Road Map "Web Pages That Think"™

window window frame self top parent closedN3,M4 alert("msg") onBlur=N3,M4 defaultStatus back()N4 onDragDrop=N4,(S) document blur()N3,M4 onFocus=N3,M4 history document location toolbar, etc. frames[i] captureEvents(type)N4 onLoad= N4,M4 N4 history clearInterval(ID) onMove= link anchor layer form applet image area innerHeightN4,(S) clearTimeout(ID) onResize=N4,M4 innerWidthN4,(S) close() onUnload= location confirm("msg") text radio button fileUpload select locationbarN4,(S) disableExternalCapture()N4,(S) menubarN4,(S) enableExternalCapture()N4,(S) textarea checkbox reset option name find(["str"][,case, bkwd])N4 password submit onerrorN3,M4 focus()N3,M4 openerN3,M3 forward()N4 outerHeightN4,(S) handleEvent(event)N4 outerWidthN4,(S) home()N4 pageXOffsetN4 moveBy(Dx,Dy)N4,(S) 4 Document Object Model Containment Hierarchy pageYOffsetN4 moveTo(x,y)N4,(S) parent open(URL,"name","specs")(1),(S) N4 personalbarN4,(S) print()N4 document layer scrollbarsN4,(S) prompt("msg","reply") alinkColor captureEvents(type)N4 (None) above load("filename",y) onBlur= self releaseEvents(type)N4 anchors[i] clear() background moveAbove(layerObj) onFocus= status resizeBy(Dx,Dy)N4,(S) applets[i]N3,M4 close() below moveBelow(layerObj) onLoad= statusbarN4,(S) resizeTo(width,height)N4,(S) bgColor getSelection()N4,(2) bgColor moveBy(Dx, Dy) onMouseOut= toolbarN4,(S) routeEvent(event)N4 cookie handleEvent(event)N4 clip.top moveTo(x, y) onMouseOver= top scroll(x,y)N3,M4 domainN3,M4 open("mimetype" [,replace])(3) clip.left moveToAbsolute(x, y) onMouseUp= window scrollBy(Dx,Dy)N4 embeds[i]N3,M4 releaseEvents(type)N4 clip.right resizeBy(Dx,D y) scrollTo(x,y)N4 fgColor routeEvent(event)N4 clip.bottom resizeTo(width, height) setInterval(func, msec [,args])N4,M4,(2) forms[i] write("string") clip.width setTimeout(func, msec [,args])N4,M4,(3) images[i]N3,M4 writeln("string") clip.height stop()N4 lastModified document N4 (1)New window specs for all browsers: height, width, toolbar, location, directories, layers[i] left status, menubar, scrollbars, resizable, copyhistory. Add'l specs for Navigator 4: linkColor name alwaysLowered(S), alwaysRaised(S), dependent, hotkeys, innerHeight, innerWidth, links[i] pageX (1) outerHeight, outerWidth, screenX, screenY, titlebar(S), z-lock(S). location pageY (2)Optional args parameter added to N4; 3rd parameter in M4 is for scripting language. referrer parentLayer (3)Third parameter in N4 for args; in M4 for scripting language. title siblingAbove URLN3,M4 siblingBelow vlinkColor src N4 N4 N4 top

locationbar , menubar , personalbar , (1)Replaced by the URL property in Navigator 3. visibility N4 N4 N4 scrollbars , statusbar , toolbar (2)M4 has a document.selection property to retrieve the currently selected text. zIndex (3)mimetype parameter new in M4, but only "text/" type supported. visible (None) (None) How to Use This Map location The hierarchy diagram shows the relationships among various HTML-generated objects in Netscape Navigator 4. history hash assign("URL") (None) length back() (None) host reload([unconditional])N3,M4 Follow the dark lines to create references to objects: current(S),(1) forward() hostname replace("URL")N3,M4 href window.document.formName.textName.value next(S),(1) go(int | "URL") pathname (S),(1) previous port The three columns in the individual object listings show the (1)Introduced in Navigator 3.0 for use with a trial security method no longer in use. protocol Properties, Methods, and Event Handlers for the object. Available in Navigator 4 with signed scripts. search

©1998 Danny Goodman. All Rights Reserved. 1 Read Danny Goodman's JavaScript Bible Netscape Navigator 4 Object Road Map

image N3,(1),M4 link () area N3,M4 border (None) onAbort= hash (None) onClick= hash (None) onClick=N4 complete onError= host onDblClick=N4,(1),M4 host onMouseOut= height onLoad= hostname onMouseDown=N4,M4 hostname onMouseOver= hspace href onMouseOut=N3,M4 href lowsrc pathname onMouseOver= pathname name port onMouseUp=N4,M4 port src protocol protocol vspace search search width target target xN4 textN4 N3,M3 yN4 xN4 applet yN4 (1)Implemented in MSIE 3 for , but not Windows. (Java vars) (Java methods) (None) (1)Not implemented for Macintosh Navigator 4. Browser Compatibility Guide JavaScript Levels This map is a Netscape-centric view of JavaScript. No items anchor () JavaScript has gone through three versions. The following browsers support features from the corresponding JavaScript unique to Microsoft (MSIE) are listed, but nameN4,M4 (None) (None) level: Netscape-only items are. textN4 xN4 Browser JavaScript Level Items that have no superscript notation are available to all yN4 JavaScript-enabled browsers, including Navigator 2 and Netscape Navigator 2.0x 1.0 MSIE 3. Superscript notations are keyed as follows: MS Internet Explorer 3.0x 1.0 N3 -- New in Netscape 3 Netscape Navigator 3.0x 1.1 N4 -- New in Netscape Navigator 4 Netscape Navigator 4.0x 1.2 M3 -- New in Netscape 3 and MSIE 3 form MS Internet Explorer 4.0x 1.2 M4 -- New in MSIE 4 action handleEvent(evt)N4 onReset=N3,M4 J2 -- New in MSIE 3, JScript.dll Version 2 elements[i] reset()N3,M4 onSubmit= No other mainstream browsers support JavaScript. (S) -- Requires Netscape Navigator 4 Signed Scripts encoding submit() length If an item shows N3 or N4 but not M3 or M4, it means that method name the feature is Netscape-only, and is not available in MSIE. target select text, textarea, password, hidden radio length blur()N3,M4 onBlur= defaultValue blur() onBlur= checked click() onClick= name focus()N3,M4 onChange= form focus() onChange= defaultChecked handleEvent(evt)N4 onMouseDown=N4,M4 N4 options[i] handleEvent(evt)N4 onFocus= name handleEvent(event) onFocus= length onMouseUp=N4,M4 options[i].defaultSelected typeN3,M4 select() onKeyDown=N4,M4 name options[i].index value(1) onKeyPress=N4,M4 typeN3,M4 options[i].selected onKeyUp=N4,M4 value options[i].text onSelect= options[i].value (1)Password value returns empty string in Navigator 2. selectedIndex N3,M4,(1) typeN3,M4 fileUpload checkbox name blur() onBlur= checked click() onClick= value focus() onFocus= button, reset, submit N4 onSelect= defaultChecked handleEvent(evt)N4 onMouseDown=N4,M4 handleEvent(evt) name click() onClick= select() name onMouseUp=N4,M4 typeN3,M4 N4 onMouseDown=N4,M4 handleEvent(evt) typeN3,M4 (1)IE4 does not use Netscape's "fileUpload" terminology, but both objects refer to value onMouseUp=N4,M4 value the same kind of tag.

1 2 ©1998 Danny Goodman. All Rights Reserved. Netscape Navigator 4 Global Objects

Math String navigator (1) Event(None) N4 E abs(val) length anchor("anchorName") appCodeName javaEnabled()N3,M4 ALT_MASK (None) LN2 acos(val) prototypeN3 big() appName preference(name[,val])N4,(S),(2) CONTROL_MASK LN10 asin(val) blink() appVersion taintEnabled()N3,M4 SHIFT_MASK LOG2E atan(val) bold() languageN4 META_MASK LOG10E atan2(val1, val2) charAt(index) mimeTypes[i]N3 MOUSEDOWN PI ceil(val) charCodeAt([i])N4,M4 platformN4 MOUSEUP SQRT1_2 cos(val) concat(string2)N4,M4 plugins[i]N3 MOUSEOVER SQRT2 exp(val) fixed() userAgent MOUSEOUT fontcolor(#rrggbb) floor(val) (1)Contained by window object in M4 MOUSEMOVE fontsize(1to7) log(val) (2)Preference names: general.always_load_images; MOUSEDRAG N4,M4 max(val1, val2) fromCharCode(n1...) security.enable_java; .enabled; CLICK min(val1, val2) indexOf("str" [,i]) browser.enable_style_sheets; autoupdate.enabled; DBLCLICK pow(val1, power) italics() network.cookie.cookieBehavior; network.cookie.warnAboutCookies KEYDOWN random() lastIndexOf("str" [,i]) KEYUP round(val) link(URL) KEYPRESS sin(val) match(regexp)N4,M4 DRAGDROP sqrt(val) replace(regexp,str)N4,M4 N3 N3 FOCUS tan(val) search(regexp)N4,M4 plugin mimeType BLUR slice(i,j)N4,J2 description refresh() description (None) SELECT small() filename enabledPlugin CHANGE split(char)N3,(1),M4 length type RESET Date strike() name suffixes SUBMIT sub() SCROLL N3 prototype get/set[UTC]Date() substr(start,length)N4,M4 LOAD get/set[UTC]Day() substring(intA, intB) UNLOAD get/set[UTC]Hours() sup() functionN3,J2 XFER_DONE get/set[UTC]Minutes() toLowerCase() ABORT get/set[UTC]Month() toUpperCase() arguments[ ] (None) ERROR get/set[UTC]Seconds() arityN4 (1)Added behavior in N4 includes: ability to accept a LOCATE get/set[UTC]Time() caller MOVE get/set[Full]Year() regexp parameter; second parameter (limit integer) to limit the number of splits to be included; a space prototype RESIZE getTimezoneOffset() string parameter signifying any white space FORWARD parse("dateString") character. N4,M4 HELP toGMTString() N3,J2 RegExp BACK toLocaleString() Array input (None) toString() lengthJ2 concat(array2)N4,M4 multiline UTC(date vals) J2 N4 prototypeN3,J2 join("char") lastMatch event(None) [UTC] and [Full] add-ons available in N4,M4. push()N4 lastParen pop()N4 leftContext data(1) (None) reverse()J2 rightContext layerX N4 layerY N4,M4,(1) shift() $1...$9 screen slice(i,[j])N4,M4 modifiers(2) J2 N4,M4 pageX availHeight (None) sort(compareFunc) N4 Regular Expression pageY availLeft(2) unshift() global compile(regexp) screenX (2) availTop Number N3,J2 ignoreCase exec("string")(1) screenY availWidth lastIndex test("string") target colorDepth MAX_VALUE toString() source str.match(regexp)(1) type height MIN_VALUE str.replace(regexp,str)(1) which(3) width NaN str.search(regexp) (1) pixelDepth(2) NEGATIVE_INFINITY str.split(regexp[,limit] URL of dragdrop event (2)Event.ALT_MASK, Event.CONTROL_MASK, (1)Contained by window object in M4 POSITIVE_INFINITY (1)Returns an array with properties: index, input, [0], Event.SHIFT_MASK, Event.META_MASK (2)Not in M4 prototype [1]...[n] (3)Mouse button (1=left; 3=right); Key char code 3 ©1998 Danny Goodman. All Rights Reserved. Operators Control Statements

Comparison if (condition) { fold here == Equals statementsIfTrue != Does not equal } > Is greater than >= Is greater than or equal to if (condition) { < Is less than statementsIfTrue <= Is less than or equal to } else { statementsIfFalse Arithmetic } + Plus (and string concat.) - Minus result = condition ? expression1 : expression2 JavaScript Object * Multiply / Divide for ([init expr]; [condition]; [update expr]) { % Modulo statements ++ Increment } -- Decrement Road Map and -val Negation for (var in object) { statements Assignment } = Equals += Add by value while (condition) { Compatibility Guide -= Subtract by value statements *= Multiply by value } ® /= Divide by value Netscape Navigator 4 Edition %= Modulo by value with (object) { 2 January 1998 <<= Left shift by value statements >>= Right shift by value } >>>= Zero fill by value &= Bitwise AND by value do { |= Bitwise OR by value statements ^= Bitwise XOR by value } while (condition) N4,M4 A special service to readers of Boolean switch (expression) { JavaScript Bible, 3rd Edition && AND case label1 : || OR statements by Danny Goodman ! NOT [break] case label2 : ISBN 0-7645-3188-3 Bitwise statements & Bitwise AND [break] | Bitwise OR ... ^ Bitwise XOR [default : ~ Bitwise NOT statements] << Left shift } N4,M4 >> Right shift >>> Zero fill right shift label : N4,M4 For continued updates to the JavaScript Bible, continue [label] N4,M4 Miscellaneous break [label] N4,M4 visit the JavaScript Bible Support Center at deleteN4,M4 Property destroyer new Object creator http://www.dannyg.com/update.html this Object self-reference typeofN3,M3 Value type voidN3,M3 Return no value Global Functions escape("str" [,1]) eval(expression) unescape("str") isNaN(expression) Functions of all Objects Boolean(value)N4 parseFloat("string") watch(id, handler)N4 toString() Number("str")N4 parseInt("string") N4 N4 unwatch(id) String(value) ©1998 Danny Goodman. All Rights Reserved. fold here 4