Table of Contents:
Netscape JavaScript 1.2 Functions/Constants

Workarounds Available:
 
arity
back
captureEvents
charCodeAt
clearInterval
concat (Array)
concat (String)
delete
disableExternalCapture
do
enableExternalCapture
fromCharCode
getSelection
handleEvent
home
innerHeight
innerWidth
layer
layers
locationbar
menubar
moveBy
moveTo
OnDblClick
OnDragDrop
OnKeyDown
OnKeyPress
OnKeyUp
OnMouseDown
OnMouseMove
OnMouseUp
OnMove
OnResize
outerHeight
outerWidth
pageXOffset
pageYOffset
personalbar
platform
pop
print
push
releaseEvents
resizeBy
resizeTo
routeEvent
screen
scrollbars
scrollBy
scrollTo
setInterval
shift
slice
splice
statusbar
stop
switch
toolbar
unshift
substr
screenX
screenY
titlebar
No Workarounds Available:
 
$1
$2
$3
$4
$5
$6
$7
$8
$9
input
$_
multiline
$*
lastMatch
$&
lastParen
$+
leftContext
$\Q
rightContext
$
compile
Event
exec
export
find
import
language
match
preference
RegExp
replace
search
text
arguments
test

arity

Areas Affected:
Javascript 1.2 new Functions



Background Information:
The latest release of JavaScript, 1.2, has functionality embedded into it for determining the number of arguments that will are expected for a function call. That feature comes in the form of functionName.arity.



Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 // "function" is any function name 
function_name.arguments.length()
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
captureEvents, getSelection, handleEvent, releaseEvents, resizeTo, resizeBy, scrollTo, scrollBy, routeEvent, screen, scrollbars, innerHeight, innerWidth, locationbar, menubar, outerHeight, outerWidth, pageXOffset, pageYOffset, personalbar, toolbar, disableExternalCapture, enableExternalCapture, moveBy, moveTo, print, stop, home, statusbar, titlebar, back

Area Affected
Microsoft's objects:
document's properties: bgColor, charset, activeElement, aLinkColor, BODY, cookie, defaultCharset, domain, expand, fgColor, fileCreatedDate, fileModifiedDate, fileSize, lastModified, linkColor, location, parentWindow, protocol, readyState, selection, TITLE, uniqueID, URL, vlinkColor
document's colletions: all, anchors, children, embeds, forms, frames, images, links, scripts, styleSheets
document's methods: attachEvent, clear, close, createElement, createStyleSheet, detachEvent, elementFromPoint, execCommand, open, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandValue, recalc, write, writeln.
document's events: onclick, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, on mouseout, onmouseover, onmouseup, onpropertychange, onreadystatechange
window's properties: name, clientInformation, closed, complete, defaultStatus, dialogArguments, dialogHeight, dialogLeft, dialogTop, dialogWidth, document, event, external, frames, history, length, location, navigator, offscreenBuffering, opener, parent, returnValue, screen, screenLeft, screenTop, self, status, top
window's methods: alert, attachEvent, blur, clearInterval, clearTimeout, close, confirm, detachEvent, execScript, focus, moveBy, moveTo, navigate, open, prompt, resizeBy, resizeTo, scroll, scrollBy, scrollTo, setInterval, setTimeout, showHelp, showModelDialog
window's events: onbeforeunload, onblur, onerror, onfocus, onhelp, onload, onresize, onunload.

Netscape's document object:
document's properties: alinkColor, anchors, applets, bgColor, cookie, domain, embeds, fgColor, formName, forms, images, lastModified, layers, linkColor, links, plugins, referrer, title, URL, vlinkColor.
document's methods: captureEvents, close, getSelection, handleEvent, open, releaseEvents, routeEvent, write, writeln.
document's events: onClick, onDblClick, onKeyDown, onKeypress, onKeyUp, onMouseDown, onMouseUp
window's properties: closed, defaultStatus, document, frames, history, innerHeight, innerWidth, length, location, locationbar, menubar, name, opener, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, personalbar, scrollbars, self, status, statusbar, toolbar, top, window
window's methods: alert, back, blur, captureEvents, clearInterval, clearTimeout, close, confirm, disableExternalCapture, enableExternalCapture, find, focus, forward, handleEvent, home, moveBy, moveTo, open, print, prompt, releaseEvents, resizeBy resizeTo, routeEvent, scroll, scrollBy, scrollTo, setInterval, setTimeout, stop
window's events: onBlur, onDragDrop, onError, onFocus, onLoad, onMove, onResize, onUnload

CSS Properties
Font and Text Properties: fontFamily, fontSize, fontStyle, fontVariant, fontWeight, font, letterSpacing, lineHeight, wordSpacing, textAlign, textDecoration, textIndent, textTransform, verticalAlign
Colors and Background Properties: color, backgroundAttachment, backgroundColor, backgroundImage, backgroundPosition, backgroundRepeat, background
Box/Layout Properties: borderBottomColor, borderLeftColor, borderRightColor, borderTopColor, borderColor, borderBottomStyle, borderLeftStyle, borderRightStyle, borderTopStyle, borderStyle, borderBottomWidth, borderLeftWidth, borderRightWidth, borderTopWidth, borderWidth, borderBottom, borderLeft, borderRight, borderTop, border, clear, float, marginBottom, marginLeft, marginRight, marginTop, margin, paddingBottom, paddingLeft, paddingRight, paddingTop, padding
Positioning Properties: clop, height, left, overflow, position, top, visibility, width, zIndex
Other Properties: display, cursor, listStyleImage, listStylePosition, listStyleType, listStyle



Background
Dynamic HTML gives the developer full control over their web page. Dynamic HTML in Microsoft's Internet Explorer 4.0 provides complete access to every element, every style, all the content on the page, as well as any user event anywhere on the page.
Netscape Navigator 4.0 on the other hand, only supports events on a few elements and support for CSS-Positioning, and does not have the ability to change the style nor access the content on the page.
Therefore, when designing for both browsers, you need to look for a common ground or you need to clearly understand the browser's capabilities and work around them as appropriate. The common ground for Dynamic HTML is CSS Positioning. While the syntax for positioning elements is the same, the object model for animating and responding to user events is different.



Workaround
This is why DHTMLLib is designed. DHTMLLib is a cross-browser solution for developing pages with CSS positioning. Different from most cross-browser solutions, DHTMLLib not only allows you to animate positioned elements, but you also have access to the user's events. For events, Internet Explorer's powerful event bubbling model is emulated in Netscape for positioned elements, allowing you to write generic, reusable code.
With this library, it resolves most of the incompatibility issues regarding layers, CSS positioning, event handling, write your code with IE4's object model (DOM) and it will run on both 4.0 browsers.

To use this library, you need to include the file, http://www.insidedhtml.com/positioning/dhtmlLib.js, in your script as follows:
<SCRIPT SRC="http://www.insidedhtml.com/positioning/dhtmllib.js" LANGUAGE="Javascript"></SCRIPT>



References
Article "DHTML Library", http://www.insidedhtml.com/positioning/home.htm

Table of Contents

charCodeAt

Areas Affected:
Javascript 1.2 Function - String Object



Background Information:
charCodeAt returns a number containing the specified character's value in the ISO-Latin-1 code set.


Workaround:
Javascript 1.1 Need to store the ISO Latin-1 character set into an array and then do a table lookup to convert the characters to index in the character set.
Javascript 1.0 Need to store the ISO Latin-1 character set into an array and then do a table lookup to convert the characters to index in the character set. Since Javascript 1.0 does not have an array constructor, you'll need to look up the array script workaround to do this. 
JScript 3.0 This method exists on the String object.
JScript 2.0 Need to store the ISO Latin-1 character set into an array and then do a table lookup to convert the characters to index in the character set.
JScript 1.0 Need to store the ISO Latin-1 character set into an array and then do a table lookup to convert the characters to index in the character set.
VBScript 3.0 ' CharCodeAt ("ABCDE",3) results 67 (ascii value of C)
Function CharCodeAt (str,pos)
        CharCodeAt = Asc(mid(str,pos,pos+1))
End Function

Table of Contents
 

clearInterval

Areas Affected:
Javascript 1.2 new Functions



Background Information:
Stops repeated execution of a function that was started by setInterval()


Workaround:
 
Javascript 1.1
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
// This Script uses setTimeout() and clearTimeout() to simulate
// JavaScript 1.2 functions: setInterval() and clearInterval()

var timerID = null  // ID needed to stop the Timeout
var timerRunning = false
var nNum = 0 ;
var nInterval = 500; // milliseconds
function stopCount(){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}

function startCount(){
        // Make sure the Count is stopped
        stopCount();
        ShowCount( nInterval );
}

// This function calls itself recursively to simulate setInterval()
// Notice the interval setting, i, is passed twice
// Once as a parameter for next ShowCount(), and another time as
// the parameter for setTimeout().
function ShowCount(i){
        nNum ++;
        document.Count.face.value = nNum;
        timerID = setTimeout("ShowCount(" + i +")",i)
        timerRunning = true
}

function OnClick() {
        if( timerRunning ) {
                stopCount();
                document.Count.button_name.value = "Start Counter";
        } else {
                startCount();
                document.Count.button_name.value = "Stop Counter";
        }
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="Count" onSubmit="0">
<INPUT TYPE="text" NAME="face" SIZE=12 VALUE ="">
<INPUT TYPE=button NAME="button_name" VALUE="Start Counter"
onclick="OnClick()">
</FORM>
</BODY>
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

compile

Areas Affected:
Javascript 1.2 Functions - RegExp Object



Background Information:
Converts a pattern to a compiled form for fffaster execution.



Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

concat (Array)

Areas Affected:
Javascript 1.2 Function - Array Object



Background Information:
Returns a new array formed by concatenating (joining) two existing arrays.


Workaround:
 
Javascript 1.1
arr1 = new Array( 1, 2, 3 );
arr2 = new Array( 4, 5, 6 );
var NewArr = new Array( 1 );
NewArr = ConcatJS11( arr1, arr2 );
document.write( NewArr );

function ConcatJS11( arr1, arr2 ) {
        nTotalLength = arr1.length + arr2.length;
        arr3 = new Array( nTotalLength );
        
        // Copy arr1 into arr3
        for( i = 0; i < arr1.length; i++ ) {
                arr3[ i ] = arr1[ i ]; }
        // Copy arr2 into arr3
        for( i = 0; i < arr2.length; i++ ) {
                arr3[ i + arr1.length ] = arr2[ i ];}
        return arr3;  } //end ConCatJS11
Javascript 1.0 function makeArray(n) { 
    for ( var i=1; i<n; i++ ) 
        { this[i]=0    } 
    return this } 

var arr1 = makeArray(3); 
var arr2 = makeArray(3); 
arr1[1] = 1; arr1[2] = 2; arr1[3] = 3; 
arr2[1] = 4; arr2[2] = 5; arr2[3] = 6; 
var NewArr = makeArray (6) 

function ConcatJS10(arr1,arr2) { 
    for ( var i=1; i<3; i++ ) 
        { NewArr[i] = arr1[i]; } 
    for ( var i=1; i<3; i++ ) 
        { NewArr[3+i] = arr2[i]; }}

JScript 3.0 var a, b, c; 
a = new Array(0,1,2,3,4); 
b = new Array(5,6,7,8,9); 
c = a.concat(b);
JScript 2.0 Use Javascript 1.0 or Javascript 1.1 workaround.
JScript 1.0 Use Javascript 1.0 or Javascript 1.1 workaround.
VBScript 3.0 dim list1(9) 
dim list2(9) 
dim NewArr() 

Sub Concat (list1,list2) 
    dim num 
    num=(ubound(list1)-lbound(list1))+(ubound(list2)-lbound(list2))+1 
    redim NewArr(num) 
    dim counter 

    counter = 0 
    For i = LBound(list1) to UBound(list1) 
        NewArr (counter) = list1(i) 
        counter = counter + 1 
    Next 
    For j = LBound(list2) to UBound(list2) 
        NewArr(counter) = list2(j) 
        counter = counter + 1 
    Next 
End Sub

Table of Contents
 

concat (String)

Areas Affected:
Javascript 1.2 Function - String Object



Background Information:
Returns a new string formed by concatenating (joining) two existing strings.


Workaround:
 
Javascript 1.1 function strConcat (str1, str2) { 
     return str1 + str2 }
Javascript 1.0 function strConcat (str1, str2) { 
     return str1 + str2 }
JScript 3.0 var a, b, c; 
a = new Array(0,1,2,3,4); 
b = new Array(5,6,7,8,9); 
c = a.concat(b);
JScript 2.0 function strConcat (str1, str2) { 
     return str1 + str2 }
JScript 1.0 function strConcat (str1, str2) { 
     return str1 + str2 }
VBScript 3.0 Function Concat (str1,str2) 
     Concat = str1 & str2 
End Function

Table of Contents
 

delete

Areas Affected:
Javascript 1.2 Functions



Background Information:
This operator is used to delete elements of an array or properties of an object.


Workaround:
 
Javascript 1.1 // arr = source array from which the element will be deleted. 
// index = the element that will be deleted. 1 <= index <= 
// arr.length 
function arrDelete(arr,index) { 
  return arr.slice(0,index-1).concat(arr.slice(index,arr.length));}
Javascript 1.0 Since the array constructor is not supported, the Array workaround can be used. With this structure in mind, modifying the Javascript 1.1 delete workaround (above) should be simple.
JScript 3.0 Javascript 1.1 workaround will be the same.
JScript 2.0 Javascript 1.1 workaround will be the same.
JScript 1.0 Javascript 1.0 workaround will be the same.
VBScript 3.0 ' arr = source array where the index starts at 0. 
' 0 <= index <= UBound(arr)-1 
Function arrDelete (arr,index) 
    redim NewArray (UBound(arr) - 1) 
    dim counter 

    counter = 0 
    For i = 0 to index - 1 
        NewArray (counter) = arr(i) 
        counter = counter + 1 
    Next 
    For i = index+1 to UBound(arr) 
        NewArray (counter) = arr(i) 
        counter = counter + 1 
    Next 
    arrDelete = NewArray 
End Function

Table of Contents
 

do

Areas Affected:
Javascript 1.2 Functions



Background Information:
This keyword is used to create do...while loops.


Workaround:
 
Javascript 1.1 while (expr) { stmts; }
Javascript 1.0 while (expr) { stmts; }
JScript 3.0 while (expr) { stmts; }
JScript 2.0 while (expr) { stmts; }
JScript 1.0 while (expr) { stmts; }

Table of Contents

Event

Areas Affected:
Javascript 1.2 Event Object



Background Information:
Provides properties that are used as bit masks to manage event handlers.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

exec

Areas Affected:
Javascript 1.2 Function - RegExp Object



Background Information:
Executes a search for matches in a string. This method scans the specified string looking fo a substring that matches the regular expression. If no match is found, exec() returns null. If a match is found, exec() returns an array of results, and also modifies properties of the pattern object and the global RegExp object.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

export

Areas Affected:
Javascript 1.2 Signed Scripts



Background Information:
This keyword is used by signed scripts to make objects, properties and methods available to other scripts.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

find

Areas Affected:
Javascript 1.2 Functions



Background Information:
Returns true if the specified string is found in a window's document.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

fromCharCode

Areas Affected:
Javascript 1.2 Function - String Object



Background Information:
Returns a string constructed from numeric values representing characters. Character code values can be extracted from a string by the charCodeAt() method.


Workaround:
 
Javascript 1.1 See Javascript 1.0 workaround
Javascript 1.0 function fromCharCodeJS10 (CharCode) { 
    return "&#" + CharCode; 
}
JScript 3.0 fromCharCode ( )
JScript 2.0 See Javascript 1.0 workaround
JScript 1.0 See Javascript 1.0 workaround
VBScript 3.0 chr(CharCode), where 0 <= CharCode <= 255

Table of Contents

import

Areas Affected:
Javascript 1.2 new Functions



Background Information:
This keyword is used to allow a script to access the variables of a signed script which have been made available by the export statement.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
$1, $2, $3, $4, $5, $6, $7, $8, $9, input, $_, multiline, $*, lastMatch, $&, lastParen, $+, leftContext, $`, rightContext, $'

Areas Affected:
Javascript 1.2 Regular Expression Variables



Background Information:
The value of the $1...$9 properties is modified whenever a successful parenthesized match is made. Any number of parenthesized substrings may be specified in a regular expression pattern, but only the nine most recent can be stored.



Workaround:
Javascript 1.1 RegExp Property - No Workaround exists
Javascript 1.0 RegExp Property - No Workaround exists
JScript 3.0 Same as Javascript 1.2 code
JScript 2.0 RegExp Property - No Workaround exists
JScript 1.0 RegExp Property - No Workaround exists

Table of Contents
 

language

Areas Affected:
Javascript 1.2 Functions - Navigator Object



Background Information:
This property allows a script to determine the language of the browser on which it is running, for example, "en" for English. This can be used to determine what type of text to display.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents

layers, layer

Areas Affected:
Layer's Properties: above, background, bgColor, below, clip.bottom, clip.height, clip.left, clip.right, clip.top, clip.width, document, left, name, pageX, pageY, parentLayer, siblingAbove, siblingBelow, src, top, visibility, zIndex
Layer's Methods: captureEvents, handleEvent, load, moveAbove, moveBy, moveTo, moveToAbsolute, releaseEvents, resizeBy, resizeTo, routeEvent.
Layer's Events: onBlur, onFocus, onLoad, onMouseOut, onMouseOver.

IFrame's Properties: accessKey, align, dataFld, dataSrc, frameBorder, frameSpacing, hspace, id, lang, language, marginHeight, marginWidth, name, noResize, scrolling, src, style, tabIndex, title, vspace, innerHTML, innerText, isTextEdit, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, recordNumber, sourceIndex, style, tagName, uniqueID
IFrame's Methods: attachEvent, blur, contains, detashEvent, focus, getAttribut, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView, setAttribute



Background Information:
Both NN4 specific Layer element and IE4/HTML 4 IFrame element allow you to place content at an absolute position and embed other documents within one's web page. However, there are some significant differences between these two elements which make them not fully interchangeable.


Workaround:
In the article "Targeting Layers", , the author gives Layers and IFrames dual identities. And shows how to make layers act as a link target just like a frame and make IFrames remove their border and automatically size to their contents.

Targeting Layers: http://www.insidedhtml.com/tips/contents/ts10/page1.asp

Table of Contents

match

Areas Affected:
Javascript 1.2 Functions - Regular Expression



Background Information:
Matches a regular expression against a string and returns various results.


Workaround:
 
Javascript 1.1 Method of the String Object using Regular Expressions only supported in Javascript 1.2 - No Workaround exists.
Javascript 1.0 Method of the String Object using Regular Expressions only supported in Javascript 1.2 - No Workaround exists.
JScript 3.0 Same as Javascript 1.2 code
JScript 2.0 Method of the String Object using Regular Expressions only supported in Javascript 1.2 - No Workaround exists.
JScript 1.0 Method of the String Object using Regular Expressions only supported in Javascript 1.2 - No Workaround exists.
VBScript 3.0 No Workaround exists

Table of Contents
 
OnMouseDown, OnMouseMove, OnMouseUp, OnKeyUp, OnKeyPress, OnKeyDown, OnDragDrop, OnDblClick, OnMove, OnResize, screenX, screenY

Areas Affected:
Events, Event Handler, Event Model
Microsoft's Event Model:
event object's properties: altKey, button, cancelBubble, clientX, clientY, ctrlKey, dataFld, dataTransfer, fromElement, keyCode, offsetX, offsetY, propertyName, reason, recordset, returnValue, screenX, screenY, shiftKey, srcElement, srcFilter, toElement, type, x, y.
Microsoft's Events: onabort, onafterupate, onbeforecopy, onbeforecut, onbeforepaste, onbeforeunload, onbeforeupdate, onblur, onbounce, oncellchange, onchange, onclick, oncopy, oncut, ondataavailable, ondatasetchanged, ondatasetcomplete, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onerrorupdate, onfilterchange, onfinish, onfocus, onhelp, onkeydown, onkeypress, onkeyup, onload, onlosecapture, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onpaste, onpropertychange, onreadystatechange, onreset, onresize, onrowenter, onrowexit, onrowsdelete, onrowsinserted, onscroll, onselect, onselectstart, onstart, onsubmit, onunload.

Netscape's Event Model:
event object's properties: data, height, layerX, layerY, modifiers, pageX, pageY, screenX, screenY, target, type, which, width
Netscape's Events: onAbort, onBlur, onChange, onClick, onDblClick, onDragDrop onError, onFocus, onKeyDown, onKeyPress, onKeyUp, onLoad, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onMove, onReset, onResize, onSelect, onSubmit, onUnload



Background Information:
Netscape's JavaScript 1.2 has a very different event model from Internet Explorer's. In fact, they are reversed.  For example, clicking on a hypertext link would cause the following event handlers to be called:

Microsoft:
1. Link
2. Layer
3. document
4. window
5. default handler
Netscape:
1. Window
2. document
3. layer
4. link
5. default handler

Microsoft uses an event bubbling model.  Event bubbling is a process in which the object associated with where the event happened receives the event first.  This object then choose to process the event or pass it along to its parent object.
NN4 uses an event capturing model, the opposite of an event bubbling model. Rather than events being generated by the bottommost object in the hierarchy, then bubbled up, events in the event capturing model are generated at the top of the object hierarchy and then fall through to events lower in the hierarchy.  A limited number of page elements can generate and process events. For example, onMouseOver is handled only images and links.



Workaround:

To write scripts that will work in both browsers, don't use the feature of passing any events to parent event handlers, since the passing order is reversed in the two browsers.  Instead, handle each event in a single function.  Also, use only the events defined for the Netscape browser, since those will work in both.

References
1) Bubble Power: Event Handling in Internet Explorer 4.0 http://www.microsoft.com/workshop/author/script/ie4event.asp
2) Dynamic HTML and The New Event Models http://www.dhtmlzone.com/articles/eventmodels.html
3) Cross Browser Dynamic HTML http://www.dhtmlzone.com/articles/dhtml.html

Table of Contents

platform

Areas Affected:
Javascript 1.2 



Background Information:
Identifies the operating system for which the browser was compiled.  Possible values include "Win32", "Win16", "Mac68k", "MacPPC", and various UNIX types.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 The most common means of getting user information in IE is through: 
Window.ClientInformation()
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists
VBScript 3.0 No Workaround exists

Table of Contents
 

pop

Areas Affected:
Javascript 1.2 new Functions



Background Information:
Removes the last element from an array and returns that element. This method changes the length of the array.

Example:

The following code displays the myFish array before and after removing its last element. It also displays the removed element:

myFish = ["angel", "clown", "mandarin", "surgeon"];document.writeln("myFish before: " + myFish);
popped = myFish.pop();
document.writeln("myFish after: " + myFish);
document.writeln("popped this element: " + popped);

This example displays the following:
myFish before: ["angel", "clown", "mandarin", "surgeon"]
myFish after: ["angel", "clown", "mandarin"] popped this element: surgeon



Workaround:
 
Javascript 1.1 //returns a new array of arr.length-1 with last element removed. 
function PopJS11(arr) { 
    if (arr.length <=1) { return new Array ();    } 

    var newarr = new Array(arr.length-1); 
    for ( var i=0; i<(arr.length -1); i++ ) 
    { newarr[i] = arr[i]; } 
    return newarr; 
}

Javascript 1.0 Since the array constructor is not supported, the Array workaround can be used. With this structure in mind, modifying the Javascript 1.1 pop workaround (above) should be simple.
JScript 3.0 Use Javascript 1.1 workaround
JScript 2.0 Use Javascript 1.1 workaround
JScript 1.0 Use Javascript 1.0 workaround

Table of Contents
 

preference

Areas Affected:
Javascript 1.2 Signed Scripts 



Background Information:
Reads and sets the browser user preferences.

Example:
reading preference
navigator.preference(pref);

setting preference
navigator.preference(pref, setting);



Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents

push

Areas Affected:
Javascript 1.2 new Functions



Background Information:
Adds one or more elements to the end of an array and returns that last element added. This method changes the length of the array. The behavior of the push method is analogous to the push function in Perl 4. Note that this behavior is different in Perl 5.

Example:
The following code displays the myFish array before and after adding elements to its end. It also displays the last element added:

myFish = ["angel", "clown"];
document.writeln("myFish before: " + myFish);
pushed = myFish.push("drum", "lion");
document.writeln("myFish after: " + myFish);
document.writeln("pushed this element last: " + pushed);

This example displays the following:
myFish before: ["angel", "clown"]
myFish after: ["angel", "clown", "drum", "lion"]  pushed this element last: lion



Workaround:
 
Javascript 1.1 //returns a new array of arr.length+1 with 'data' appended. 
function PushJS11(arr, data) { 
    arr[arr.length] = data; 
    return arr; 
}
Javascript 1.0 Since the array constructor is not supported, the Array workaround can be used. With this structure in mind, modifying the Javascript 1.1 push workaround (above) should be simple.
JScript 3.0 Use Javascript 1.1 workaround
JScript 2.0 Use Javascript 1.1 workaround
JScript 1.0 Use Javascript 1.0 workaround
VBScript 3.0 No Workaround exists

Table of Contents
 

RegExp

Areas Affected:
Javascript 1.2 Regular Expressions



Background Information:
Creates a new regular expression object; also provides properties that control matches and return results. Regular expressions are a powerful tool for manipulating text. A regular expression, also called a pattern, is a sequence of characters that defines a string or set of strings that can be searched for and replaced.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

replace

Areas Affected:
Javascript 1.2 Function - String Object



Background Information:
Replaces a specified substring with another. This method returns a string containing a copy of the original string in which one or more substrings that match the regular expression have been replaced.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents

search

Areas Affected:
Javascript 1.0 Tainted



Background Information:
Modifying search causes the window to be reloaded using the new URL. Note, however, that it is considered safer to set the href property to ensure that the entire URL is correctly updated. Queries are used in http:// URLs to request specific information.

Example:

window.location.search = "?qt=ben+jerry&col=WW&Search.x=45&Search.y=9"



Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

setInterval

Areas Affected:
Javascript 1.2 Functions



Background Information:
This method when executed with an object will cause a specified function to execute periodically. The time period is specified by the user.


Workaround:
 
Javascript 1.1
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
// This Script uses setTimeout() and clearTimeout() to simulate
// JavaScript 1.2 functions: setInterval() and clearInterval()

var timerID = null  // ID needed to stop the Timeout
var timerRunning = false
var nNum = 0 ;
var nInterval = 500; // milliseconds
function stopCount(){
        if(timerRunning)
                clearTimeout(timerID);
        timerRunning = false;
}

function startCount(){
        // Make sure the Count is stopped
        stopCount();
        ShowCount( nInterval );
}

// This function calls itself recursively to simulate setInterval()
// Notice the interval setting, i, is passed twice
// Once as a parameter for next ShowCount(), and another time as
// the parameter for setTimeout().
function ShowCount(i){
        nNum ++;
        document.Count.face.value = nNum;
        timerID = setTimeout("ShowCount(" + i +")",i)
        timerRunning = true
}

function OnClick() {
        if( timerRunning ) {
                stopCount();
                document.Count.button_name.value = "Start Counter";
        } else {
                startCount();
                document.Count.button_name.value = "Stop Counter";
        }
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="Count" onSubmit="0">
<INPUT TYPE="text" NAME="face" SIZE=12 VALUE ="">
<INPUT TYPE=button NAME="button_name" VALUE="Start Counter"
onclick="OnClick()">
</FORM>
</BODY>
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

shift

Areas Affected:
Javascript 1.2 new Functions



Background Information:
Removes the first element from an array and returns that element. This method changes the length of the array.

Example:

The following code displays the myFish array before and after removing its first element. It also displays the removed element:

myFish = ["angel", "clown", "mandarin", "surgeon"];
document.writeln("myFish before: " + myFish);
shifted = myFish.shift();
document.writeln("myFish after: " + myFish);
document.writeln("Removed this element: " + shifted);

This example displays the following:
myFish before: ["angel", "clown", "mandarin", "surgeon"]
myFish after: ["clown", "mandarin", "surgeon"]
Removed this element: angel



Workaround:
 
Javascript 1.1 function ShiftJS11(arr) { 
    if (arr.length <=1) { return new Array ();    } 

    var newarr = new Array(); 
    for ( var i=1; i<(arr.length); i++ ) 
    { newarr[i-1] = arr[i]; } 
    return newarr; 
}

Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

slice

Areas Affected:
Javascript 1.2 Function - String Object



Background Information:
Extracts a section of an array and returns a new array. slice extracts up to but not including end. slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3) As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second to last element in the sequence. If end is omitted, slice extracts to the end of the sequence.

slice does not alter the original array, but returns a new "one level deep" copy that contains copies of the elements sliced from the original array. Elements of the original array are copied into the new array as follows: If a new element is added to either array, the other array is not affected.

Example:

In the following example, slice creates a new array, newCar, from myCar. Both include a reference to the object myHonda. When the color of myHonda is changed to purple, both arrays reflect the change.

<SCRIPT LANGUAGE="JavaScript1.2">
//Using slice, create newCar from myCar.
myHonda = {color:"red",wheels:4,engine:{cylinders:4,size:2.2}}
myCar = [myHonda, 2, "cherry condition", "purchased 1997"]
newCar = myCar.slice(0,2)
//Write the values of myCar, newCar, and the color of myHonda
// referenced from both arrays.
document.write("myCar = " + myCar + "<BR>")
document.write("newCar = " + newCar + "<BR>")
document.write("myCar[0].color = " + myCar[0].color + "<BR>")
document.write("newCar[0].color = " + newCar[0].color + "<BR><BR>")
//Change the color of myHonda.
myHonda.color = "purple"
document.write("The new color of my Honda is " + myHonda.color + "<BR><BR>")
//Write the color of myHonda referenced from both arrays.
document.write("myCar[0].color = " + myCar[0].color + "<BR>")
document.write("newCar[0].color = " + newCar[0].color + "<BR>")
</SCRIPT>



Workaround:
 
Javascript 1.1
function myStringSlice( str1, begin, end ) {
        
        // check number of arguments passed into the function
        if( myStringSlice.arguments.length < 2 ) {
                return null;
        } else if( myStringSlice.arguments.length == 2 ) {
                end = str1.length;
        }
        
        // deal with negative and large values of 'begin' and 'end'
        if( end < 0 ) {
                end = str1.length + end;
        } else if( end > str1.length ) {
                end = str1.length;
        }       
        begin = ( begin < 0 ) ? 0 : begin;
        
        // assert data passed in are valid
        if( str1.length == 0 ||         // empty String
                 begin >= str1.length ||// invalid begin index
                 end <= begin ||     // invalid end index
                 end == 0               // invalid end index
        ) {
                return null;
        }
        
        str2 = "";
        for( i = begin, j = 0; i < end; i++, j++ ) {
                str2 += str1.charAt( i );
        }
        return str2;
}
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

splice

Areas Affected:
Javascript 1.2 new Functions



Background Information:
Changes the content of an array, adding new elements while removing old elements. If you specify a different number of elements to insert than the number you're removing, the array will have a different length at the end of the call. If howMany is 1, this method returns the single element that it removes. If howMany is more than 1, the method returns an array containing the removed elements.

Example:
The following script illustrate the use of splice:

<SCRIPT LANGUAGE="JavaScript1.2">
myFish = ["angel", "clown", "mandarin", "surgeon"];
document.writeln("myFish: " + myFish + "<BR>");
removed = myFish.splice(2, 0, "drum");
document.writeln("After adding 1: " + myFish);
document.writeln("removed is: " + removed + "<BR>");
removed = myFish.splice(3, 1)
document.writeln("After removing 1: " + myFish);
document.writeln("removed is: " + removed + "<BR>");
removed = myFish.splice(2, 1, "trumpet")
document.writeln("After replacing 1: " + myFish);
document.writeln("removed is: " + removed + "<BR>");
removed = myFish.splice(0, 2, "parrot", "anemone", "blue")
document.writeln("After replacing 2: " + myFish);
document.writeln("removed is: " + removed);
</SCRIPT>

This script displays:

myFish: ["angel", "clown", "mandarin", "surgeon"]
After adding 1: ["angel", "clown", "drum", "mandarin", "surgeon"]
removed is: undefined
After removing 1: ["angel", "clown", "drum", "surgeon"]
removed is: mandarin
After replacing 1: ["angel", "clown", "trumpet", "surgeon"]
removed is: drum
After replacing 2: ["parrot", "anemone", "blue", "trumpet", "surgeon"]
removed is: ["angel", "clown"]



Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents

switch

Areas Affected:
Javascript 1.2 Functions



Background Information:
This keyword is used to create multi-way branch structures that mimic if-else condition statements.


Workaround:
 
Javascript 1.1 Can format if...else statements to setup the ordered conditions.
Javascript 1.0 Can format if...else statements to setup the ordered conditions.
JScript 3.0 Can format if...else statements to setup the ordered conditions.
JScript 2.0 Can format if...else statements to setup the ordered conditions.
JScript 1.0 Can format if...else statements to setup the ordered conditions.

Table of Contents
 

unshift

Areas Affected:
Javascript 1.2 new Functions



Background Information:
Adds one or more elements to the beginning of an array and returns the new length of the array.

Example:
The following code displays the myFish array before and after adding elements to it.

myFish = ["angel", "clown"];
document.writeln("myFish before: " + myFish);
unshifted = myFish.unshift("drum", "lion");
document.writeln("myFish after: " + myFish);
document.writeln("New length: " + unshifted);

This example displays the following:
myFish before: ["angel", "clown"]
myFish after: ["drum", "lion", "angel", "clown"]



Workaround:
 
Javascript 1.1 //returns a new array of arr.length+1 with 'data' appended. 
function UnShiftJS11(arr, data) { 
    var newarr = new Array () 
    newarr[0] = data; 
    for ( var i=0; i<arr.length; i++ ) { 
    newarr[i+1] = arr[i]; 
    } 
    return newarr; 
}
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

text

Areas Affected:
Javascript 1.2 Functions



Background Information:
This property specifies the text that is displayed in the corresponding line of the selection list on the screen. The value is initially set to the text following the HTML <OPTION> tag. Scripts can modify the value at any time, and the change will be immediately displayed on the screen.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

substr

Areas Affected:
Javascript 1.2 Function - Array Object



Background Information:
Returns a substring of a specified position and length.


Workaround:
 
Javascript 1.1
function myStringSubstr( str1, begin, length ) {
        // check number of arguments passed into the function
        if( myStringSubstr.arguments.length == 2 ) {
                end = str1.length;
        } else if( myStringSubstr.arguments.length == 3 ) {
                end = begin + length;
        } else {
                return null;
        }
        str2 = myStringSlice( str1, begin, end );
        return str2;
}
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents

arguments

Areas Affected:
Javascript 1.2 Functions



Background Information:
An array that contains arguments passed to a function.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents
 

test

Areas Affected:
Javascript 1.2 Functions  - Regular Expression



Background Information:
Searches for a match to a regular expression in a specified string, and returns true if a match is found.


Workaround:
 
Javascript 1.1 No Workaround exists
Javascript 1.0 No Workaround exists
JScript 3.0 No Workaround exists
JScript 2.0 No Workaround exists
JScript 1.0 No Workaround exists

Table of Contents