August 17, 1999
In order to help developers create scripts
that run on all platforms, the WebTV browser attempts to be compatible with
Netscape's, Microsoft's, and ECMA's versions
is impossible due to the small amount of memory in the original
WebTV-based systems. This guide will outline key differences
due both to features of the WebTV browser, and bugs that are
not yet fixed.
The WebTV browser does not implement the following
windows - Since the WebTV browser does not support multiple
windows, scripts cannot open windows and subsequently read
from or write to those windows. An exception is made, however,
for windows larger than 400 by 300 pixels, which are treated
as a new page. The user can get back to the original window
by pressing the "back" button.
The lack of multiple windows has caused problems for authors
who use the window object to refer to frames. For instance,
would not work on a WebTV browser. Instead, consider using:
parent.frames.location = 'ft-top.html';
parent.frames.location = 'ft-left.html';
- Regular expressions
- For example:
var re = /a|b|c/i
- Signed scripts - Scripts digitally signed for security are not supported.
- Adding values to built-in objects - For example,
document.myVar.color is not supported; use
array.sort method in
to customize the sort order. If you need to do a numeric sort,
we recommend using a simple "bubble sort" function
like the one below. Please note that this type of sort may
not be efficient for large arrays.
The WebTV browser implements the following items differently than you may expect:
for (var i=0; i<(length-1); i++)
for (var j=i+1; j<length; j++)
if (arrayName[j] < arrayName[i])
var dummy = arrayName[i];
arrayName[i] = arrayName[j];
arrayName[j] = dummy;
- Arrays - The WebTV browser limits arrays to 32,768 elements.
- Errors - The WebTV browser does not alert
- Math - The WebTV browser uses 32 bit floats instead of 64-bit doubles. This is adequate for all but high-end
Unimplemented Functions and
form.encoding, history.next, window.onError(), and window.onUnload()
- WebTV supports read-only for
window.opener rather than read/write.
The following event handlers are not
onAbort, onError, onUnload,
keyDown, keyUp, keyPress, mouseDown, mouseMove
While WebTV Networks is always improving
the WebTV browser, certain bugs will exist at any given time.
Because WebTV Networks does not roll out patches, but rather
whole new versions of the WebTV browser, some bugs may take
months to fix. We hope listing the bugs and workarounds here
will help you in the meantime.
Form elements cannot be accessed without specifying the
"document" object before them. This is not a bug
properties must be prefaced by all object ancestors. WebTV
Networks is investigating whether to change this behavior in
Always include the explicit object hierarchy when referring
to objects, e.g.
The WebTV browser thinks it's Netscape.
When presented with the conditional
if (navigator.appname == "Netscape"), current WebTV clients will return true.
if (navigator.appname == "Netscape")
alert("Hey, what are you doing here, WebTV?");
When doing a browser sniff, check for WebTV browsers before
checking for Netscape browsers.
onClick event handler does not always work as expected when
placed in a hyperlink. When a user clicks on a hyperlink that
onClick, the event will occur, but the link will not
<a href="www.odwalla.com" onClick="alert('You
can't go there.')">Odwalla</a>
In some cases, you can get around the problem by defining statements
in a function, then calling that function from the link. In
other cases, WebTV users may have to click a link twice.