November 1, 1999 - Detecting WebTV | WebReference

November 1, 1999 - Detecting WebTV

Yehuda Shiran November 1, 1999
Detecting WebTV
Tips: November 1999

Yehuda Shiran, Ph.D.
Doc JavaScript

The number of WebTV owners is gradually rising. You might want to use JavaScript to find out if the client is a WebTV system:

if (navigator.appName.indexOf("WebTV") != -1) // WebTV detected
   document.writeln("How do you like that WebTV?");
else // not WebTV
   document.writeln("When are you going to get WebTV?"); 

You can use this technique to redirect WebTV users to a WebTV-optimized version of your site. Furthermore, you can take advantage of this sniffer to overcome various bugs in the WebTV implementation of JavaScript.