Welcome to WebmasterWorld Guest from 174.129.135.89

Forum Moderators: incrediBILL

Message Too Old, No Replies

WebTV sniffer

   
4:32 pm on Apr 11, 2001 (gmt 0)

10+ Year Member



I got this code from the WEBTV site.

I have a particular page in a frameset that I do not want exposed and web tv does just that.

I have this in the <head> and am trying to use meta refresh tags to redirect...it isnt working for some reason.

<SCRIPT LANGUAGE="JavaScript"><!--

if(navigator.appName.indexOf("WebTV") != -1) //WebTV detected
document.writeln("<meta http-equiv="refresh" content="0;URL=webtv_page.html">");

else //Non-WebTV detected.
document.writeln("<meta http-equiv="refresh" content="45;URL=super_duper_page.html">");

//-->
</SCRIPT>

5:45 pm on Apr 11, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I don't see a problem, but you say it isn't working. Is neither redirect working, or only not the WebTV?

Two experiments come to mind:
1) Try using location.href= instead of document.writeIn.
2) Redirect only the WebTV, and have this very page actually BE the non-WebTV page.

6:49 pm on Apr 11, 2001 (gmt 0)

10+ Year Member



Thanks tedster. It works using location.href

The webtv browser is a cool little tool to have. Helps discover some bad spots on your site.

4:10 am on Apr 16, 2001 (gmt 0)

10+ Year Member



<meta http-equiv="refresh" content="45;URL=connection.html">
<SCRIPT LANGUAGE="JavaScript" type="text/Javascript"><!--

if(navigator.appName.indexOf("WebTV") != -1) //WebTV detected
location.href="webtv_page.html";

else //Non-WebTV detected.
document.writeln(" ");
//-->
</SCRIPT>

This is freaking nn 4.76 out....do you see any reason why it might not work? Opera, ie5 and webtv all work fine with this.

7:12 am on Apr 16, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Don't see a problem with the JavaScript on the face of it. What message do you get from the Netscape JavaScript console?
7:12 am on Apr 16, 2001 (gmt 0)

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Ya, the js in the webtv system is pretty rudimentary. The webtv viewer for windows is pretty accurate. It is always a shock to people to view a site with it.

I was taking with a guy I know in the northwest who said ms is toying with giving away the next webtv for free when you signup for msn. If that happens...wow. They just reported that msn has only been able to muster 5million subscribers. That is with their all out promotion blitz and give away for over two years.

1:52 pm on Apr 16, 2001 (gmt 0)

10+ Year Member



Wow.

This weird.

The code works fine with all browsers on all my sites (unix) EXCEPT the one site I have on NT. This one seems to cause Netscape to lose it. It flips the page to a 404.

12:02 am on Apr 17, 2001 (gmt 0)



Try this:

<script language="JavaScript">
<!- hide from older browsers
if(navigator.appName.indexOf("WebTV") != -1)
//WebTV detected
window.location='http://www.anywhere.com/';
else
//non-WebTV detected
window.location='http://www.anywhere.com/';
//->
</script>

It should work.