TiVo recently updated their support pages, which has broken many links around the net since they seem to have moved pretty much every page and didn’t have the server redirect the old URLs to the new one. (Which is bad form in and of itself.) The new TiVo support pages seem to be IE only. Try to access any of the user guides, for example. Visit http://customersupport.tivo.com/UserGuides.aspx in Firefox and try to access a guide. For that matter try it in Opera.
The only browser it worked for me in is IE – which I normally refuse to use since it is crap (OK, IE7 is less crappy, I admit) and a common security hole. I don’t have a Mac so I don’t know if this works in Safari, but if not, then Mac users are effectively locked out since IE hasn’t been supported on Mac in years. And Linux users almost all use Firefox/Gecko based browsers, or Opera – no IE at all.
This is why there are web standards, which the pages do not follow. I mean, look at this:
<td><a id=744cd5bf7aa5604e36e11e3ed0a66b0f76d1cfe3 href=”#”></a><a id=bdabe80e8a00edc384c222e4431ff28a4e37fa30 cid=’ebee533b-f9c5-4014-b80b-0c44b2dee10a’ parameters=”samewindow~ins_Content.html~” href=”#”><img src=”Media_Resources/images/3028/ug_series3HD.gif” border=0 imgid=”80013e96-c95b-472f-a0fe-901b94e2cdc9″></a><a id=c35905bc56737b73edfa6de9a78bcea164f9ee76 href=”#”></a></td>
That’s the markup for the Series3 entry in the table. If you know HTML, you’ll immediately notice the links are bogus. And there are invalid attributes to boot. Everything is driven by an JavaScript function. Scripted links with no HTML fall back are NEVER a good idea. EVER. That’s just bad web design. If you want a (bitter) laugh, open the page with Firefox’s JavaScript Console open and watch the errors stream by. So not only did they break standards support, their broken version uses code that is broken.
In fact, here is the JavaScript, behind the cut…
function launchurl(cid,options) { if (document.referrer.indexOf("&") !=-1) { window.open(document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + cid + document.referrer.substring(document.referrer.indexOf("&")) ,'',options) } else { window.open(document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + cid,'',options) } } function showhyperlinks() { //var path=document.top.location.href; try { parent.document.title=document.title; } catch(ex) { } var arratags=document.getElementsByTagName("a"); for(var i=0;i<arratags.length;i++) { if(arratags(i).attributes.getNamedItem("cid")!=null) { var newwin=arratags(i).attributes("parameters").value.split("~") if(newwin[0]!="popup") { if (document.referrer.indexOf("&") !=-1) { arratags(i).attributes("href").value=document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + arratags(i).attributes("cid").value + document.referrer.substring(document.referrer.indexOf("&")) } else { arratags(i).attributes("href").value=document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + arratags(i).attributes("cid").value } if(newwin[0]=="samewindow") arratags(i).attributes("target").value="_parent"; } } } } //*************************************************************************** //31st august 2006;vani;to link the Site level css if skin level css is not there var applystyle; /* This is set to true during preview file generation if current skin is not having style.css otherwise it is set to false **/ if(document.styleSheets(0).href=="") { document.styleSheets(0).href=parent.document.styleSheets(0).href } //**************************changes by vani to apply styles for popup content try { if(document.styleSheets(0).href=="") { document.styleSheets(0).href=window.opener.parent.document.styleSheets(0).href } } catch (ex) { } //************************************************
It is triggered by this in the body element: onload=”showhyperlinks();”
Who thought it was a good idea to load the page with bogus hyperlinks and then programatically populate them with a script? At least give the hrefs legitimate default values and then change them with the script, so things still work when your code blows chunks. That’s a fundamental design issue. Always allow your pages to degrade gracefully. That’s important for many reasons – backwards compatibility with old browsers for one. Making sure your pages run well for the paranoid – many people turn of JavaScript completely, and this page won’t work for them either. Allowing your pages to run on other devices that may have different levels of support, like smart phones. Supporting non-traditional access devices like screen readers used by the blind and visually impaired. Hell, there is no good reason NOT to do it.
Note to TiVo’s web people: When you’re doing an array dereference, you want square brackets [], not parens (). You did that a few places. Also, the attributes[] array is busted. There is a standard version defined in the DOM, but IE implemented a non-standard version. So if you use it, it doesn’t work across browsers. Oh, and get rid of this: <link rel=”stylesheet” type=”text/css” href=”" > The empty href makes browsers default to the current document – which means they try to load the HTML as a stylesheet! BAD.
To help, I just quickly redid the JavaScript off the cuff. It seems to work in Firefox and Opera, not in IE6 though. I’d have to spend more time debugging that, but this is a start for TiVo.
function launchurl(cid,options) { if (document.referrer.indexOf("&") !=-1) { window.open(document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + cid + document.referrer.substring(document.referrer.indexOf("&")) ,'',options) } else { window.open(document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + cid,'',options) } } function showhyperlinks() { //var path=document.top.location.href; try { parent.document.title=document.title; } catch(ex) { } var arratags=document.getElementsByTagName("a"); for(var i=0;i<arratags.length;i++) { if(arratags[i].hasAttribute("cid")) { var newwin = arratags[i].getAttribute("parameters").split("~") if(newwin[0]!="popup") { if (document.referrer.indexOf("&") !=-1) { arratags[i].setAttribute("href", document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + arratags[i].getAttribute("cid") + document.referrer.substring(document.referrer.indexOf("&"))) } else { arratags[i].setAttribute("href", document.referrer.split("?")[0].substring(0,document.referrer.split("?")[0].lastIndexOf("/")+1) + "LaunchContent.aspx" + "?cid=" + arratags[i].getAttribute("cid")) } if(newwin[0]=="samewindow") arratags[i].setAttribute("target","_parent"); } } } } //*************************************************************************** //31st august 2006;vani;to link the Site level css if skin level css is not there var applystyle; /* This is set to true during preview file generation if current skin is not having style.css otherwise it is set to false **/ if(document.styleSheets[0].href=="") { document.styleSheets[0].href=parent.document.styleSheets[0].href } //**************************changes by vani to apply styles for popup content try { if(document.styleSheets[0].href=="") { document.styleSheets[0].href=window.opener.parent.document.styleSheets[0].href } } catch (ex) { } //************************************************
I really wish companies like TiVo would stop doing stupid things with their web pages and adhere to the standards – XHTML, CSS, ECMAScript, etc. There is nothing on TiVo’s site that can’t be done in a standards compliant manner. It really angers me to see this kind of thing on a major company’s site. I’m usually fairly mellow, but this kind of crap is a major pet peeve of mine. I’ve worked with web technologies since 1991 and I helped write a couple of the web standards (HTML4 & CSS2), and I know this isn’t hard to get right.
I still love TiVo, but that just makes this kind of thing piss me off all the more. When someone I don’t care about does this it doesn’t bug me as much.
OK, I’m done ranting about this. (And yes, I sent a more concise version to TiVo’s webmaster(s).)