Tutorials by DJ Mike

<td> <input type="submit" value="Go"> </td>


More WebTV Links

Killing WebTV's Javascript Bug

Everyone using WebTV is familiar with WebTV's infamous Javascript "bug". You go to a page and the drop down menus and everything else using Javascript doesn't work and there is nothing in the status bar. If the page was made by a WebTV user, it probably has some kind of notice that you have to reload the page to enable Javascript

The Javascript bug was introduced by WebTV in an attempt to stop hacking by using Javascript in emails and Javascript in pages embedded in emails but what happened is that Javascript wasn't just disabled on an embedded page, once embedded, Javascript was still disabled when the page was viewed non-embedded. Worse, when any file on a server was bugged, any other file on the same server could be bugged even if it was not embedded. For example, if you viewed a post with a midi or one of those irritating sidebar covers hosted at The Zone embedded in it, any page at The Zone that you go to later could be bugged.

The bad news first; you can't do anything to prevent someone else's page from getting bugged. Now the good news:

  1. You can reduce the chance of your own pages from getting bugged to almost zero.
  2. If you use sidebar covers, you can reduce the chance your sigs from bugging pages when you post to almost zero.
  3. If you use sidebar covers, you can reduce the chance of someone else getting a bugged page from viewing your sig to almost zero.

To stop your own page from getting bugged, all you have to do is put the code below in the head of your web page:



The date is not important as long as it is in the future. The important part is the url=wtv-home:/home. One side effect of this is that when I edit a page, I now have to reload it to see the new version. The only other drawback that I have found is that if someone comes to the page for the first time via your sig or after viewing your sig, they still may get the bug. After reloading however, the page is protected. For example, I go to my WebTV Home Page many times a day to check email and block ads on problem sites.. Before that page was protected, I had to reload it every time I posted before going there. Now, I may have to reload after one post but no more for the rest of that session. I also don't get the cascade effect; one page bugged after another near as much.

If you embed HTML pages in your sig you can add the code above in to the head of the file to stop people, including yourself, from getting bugged pages from viewing your sig if your page doesn't have any images or sounds. Like HTML files, image and sound files get the bug. Since they don't have Javascript, you can't see it by something not functioning but you can see it in the status bar. You can stop embedded HTML from causing the but you can't stop embedded sounds and images from causing the bug.

You can test this with my Ad Blocker which works by disabling Javascript. In fact, you can try to disable Javascript on this page. I had to try many times before I could. You can use PHP to power your menus for those rare times when the bug bites in spite of this cure.

This will not work on all pages. It has worked on all of the page that I made myself that I tested it on but when I tried it on my file manager, it didn't protect it. I have no idea why it didn't protect my file manager when it worked on everything else. Even though it didn't protect my file manager when I embedded it itself, it is no longer bugged when I view my sig with its embedded and iframed files.

PHP menu handler

The menu at the top of this page is powered by Javascript but it has a PHP redirector to back it up if Javascript gets disabled incspite of this page being protected. If your server supports PHP, make a file named redirect.php with the code below:

Now for your menu, make sure that the and the form's action is the URL of the redirector:

. If your host does not support PHP, you can use mine:

Add the usual Javascript to power the menu but add When Javascript is enabled, it handles the menu and tere is no button. When Javascript is disabled, the button appears so PHP can power the menu.

Cache control to kill the bug.

If you are using PHP, you can add this code to make your page 100% javacript bug proof. It has to be the very first thing in the code; not even a space or empty line before it. If you are using PHP redirects elsewhere in the code, they may be incompatible and you will have to adjust it.

Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>