woofie's toolbox - javascript for webtv
There are key things to note:
Do not go more than 15 levels deep on if...then statements. This includes going into other subroutines and in recursive subroutine calls.
Using the <display hideoptions> tag on the WebTV Internet Terminal will shut off Javascript for that page.
Semicolons; WebTV, as a subsidiary of Microsoft, has redefined Javascript to JScript. That means you will need to end every line of code with a semicolon. The Javascript specification says this is not necessary. However, this is a Microsoft environment, so standards aren't...
Negative Numbers; WebTV javascript does not work with negative numbers. For values that may be negative, wrap the value or variable with eval(). Even the basic assignment: x = -1; makes x a string containing "-1".
window.setTimeout; WebTV's version returns useless, untypeable info. lasttimeout = setTimeout("FlipLast()",5000); alert(lasttimeout); breaks javascript. So, I'm not sure how one would use clearTimeout(lasttimeout) on the system...
One should get rid of the WebTV only tags since they are phased out and ignored anyway.
Below are some tips to create desired effects.
How to get the box to load all images on the next page before displaying that page.
On pages where images are loaded dynamically, such as in games like WebTV Minesweeper, the goal is to have all the images loaded before the page displays so that the user is not waiting during the game for blank areas to fill in. To make sure all the images are loaded before hand, explicitly load the images using javascript. You can do this by making a subroutine to load the images as shown below. You need only to load images that aren't already called for in <img> Add a line of code to set one of the images on the page to the last image