The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

I think I want to cry - Javascript linking

Last post 03-25-2008 12:00 PM by Nelle. 16 replies.
Page 1 of 1 (17 items)
Sort Posts: Previous Next
  • 03-22-2008 7:17 PM

    • Weng
    • Top 500 Contributor
    • Joined on 03-15-2008
    • Posts 79

    I think I want to cry - Javascript linking

    I'm PHPifying a site whose prototype contains this:

    a href="#" onclick="sillyJavaScriptThatChangesTheBrowser'sLocation()

    On its own, this is horrifying and makes me want to quit the project (I'm already quitting the firm as soon as this project is done and I've been paid)

    However, I also discovered a Javascript function that translates that to a PROPER a href="url" setup onload.

    So Javascript enabled browsers get regular links, and Javascript-disabled browsers get.... Shafted.
  • 03-22-2008 8:47 PM In reply to

    Re: I think I want to cry - Javascript linking

     I see no end of this type of stupidity simply doing random browsing on "professional" websites. My personal rule of thumb is, the more "professional" a site is supposed to be, and the larger of a company it is supposed to represent, the more of this complete disregard of compatibility you'll see. There are even many sites done entirely in flash where the layout would be been perfectly suitable as simple html for a fraction of the cost. Menu bars, implemented in flash, that do nothing more than provide a list of links come to mind. God help you if you don't run flash. What exactly is wrong with href?

     It doesn't surprise me anymore, but it still amazes me.

  • 03-22-2008 11:24 PM In reply to

    • Weng
    • Top 500 Contributor
    • Joined on 03-15-2008
    • Posts 79

    Re: I think I want to cry - Javascript linking

    Oh, this site has flash navigation, too. And it's animated. Each link unfolds like a piece of paper, and you have to wait 10 seconds to get to the important ones. With a sound effect, too! And god forbid you accidentally stray your mouse cursor over the right angle gap to get to a link that unfolded about 15 feet ====> that way, it'll close the menu. And the fonts overflow the content areas on my Linux system (which is my dev box... So I always have to sit there, looking at my handiwork, and convince myself that it's not my fault that it looks wrong). And there are about 15 /html's at the bottom.
  • 03-22-2008 11:48 PM In reply to

    Re: I think I want to cry - Javascript linking

    Weng:
    a href="#" onclick="sillyJavaScriptThatChangesTheBrowser'sLocation()

    I also cry when I see forms with this:
    <input type="button" onclick="document.forms[0].submit();" >

    Agh! There is a form element called "submit" that will do that automatically, and without Javascript!

    Nether:
    There are even many sites done entirely in flash where the layout would be been perfectly suitable as simple html for a fraction of the cost.

    Take a look at this piece of work: http://thinkswedish.com. The entire site (blog, comments, About page) is done in Flash. But do they use complicated UIs, fancy animations, or other forms of intense interactivity that might at least partially justify an all-Flash site? Nope. The site acts exactly like a plain old HTML page. What really chaps my ass is how much work must've gone into making what amounts to an entire layout engine in ActionScript, when it's emulating the most basic type of webpage that HTML is built for. Grr.

  • 03-23-2008 1:37 AM In reply to

    • Weng
    • Top 500 Contributor
    • Joined on 03-15-2008
    • Posts 79

    Re: I think I want to cry - Javascript linking

    boolean:
    Take a look at this piece of work: http://thinkswedish.com. The entire site (blog, comments, About page) is done in Flash. But do they use complicated UIs, fancy animations, or other forms of intense interactivity that might at least partially justify an all-Flash site? Nope. The site acts exactly like a plain old HTML page. What really chaps my ass is how much work must've gone into making what amounts to an entire layout engine in ActionScript, when it's emulating the most basic type of webpage that HTML is built for. Grr.
    I enjoy that page significantly - I get a HUGE BLACK RECTANGLE on my config.
  • 03-23-2008 8:39 AM In reply to

    • stinch
    • Top 500 Contributor
    • Joined on 09-28-2005
    • Oxford, Uk
    • Posts 51

    Re: I think I want to cry - Javascript linking

    Weng:
    I enjoy that page significantly - I get a HUGE BLACK RECTANGLE on my config.

    They have created a html version. You just can't see it because they use css to position it at -5000px, 30px.

    I guess working out how to hide the html when flash is present was too difficult.

  • 03-23-2008 10:08 AM In reply to

    Re: I think I want to cry - Javascript linking

    Weng:
    I enjoy that page significantly - I get a HUGE BLACK RECTANGLE on my config.

    Ditto. Since Adobe tossed the latest Flash 9 my way, Firefox started showing regular illegal operation errors caused by Flash. I uninstalled Flash and reinstalled it properly via Firefox, and now it just causes Firefox to explode. Google suggests I'm alone with this problem. Until I can be bothered to find out why my Firefox 2 in Win2k can't do Flash 9, I'm without Flash, and yes, I get a delightful empty grey page.

    stinch:

    They have created a html version. You just can't see it because they use css to position it at -5000px, 30px.

    The brillant thing about this is the class names:

    				<div class="seo">
    					<div class="seo_content">
    
    						<div class="seo_meta">

    Obviously they've realised that robots can't read Flash, so they've catered for them with stealth content. (I don't know to what extent robots can read Flash if a Flash developer uses Flash's proper accessibility features.) Ironically, there's an indication that the site is to an extent usable without Flash, had they not sabotaged it. That said, if you disable CSS in your browser, e.g. View → Page Style → No Style in Firefox, you do get a perfectly usable site.

  • 03-23-2008 10:28 AM In reply to

    Re: I think I want to cry - Javascript linking

    boolean:
    Take a look at this piece of work: http://thinkswedish.com. The entire site (blog, comments, About page) is done in Flash. But do they use complicated UIs, fancy animations, or other forms of intense interactivity that might at least partially justify an all-Flash site? Nope. The site acts exactly like a plain old HTML page. What really chaps my ass is how much work must've gone into making what amounts to an entire layout engine in ActionScript, when it's emulating the most basic type of webpage that HTML is built for. Grr.
    But hey, it has the word "beta" on it! Everyone knows that it must be cool, right?
    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    Visit #TDWTF @ SlashNET - the semi-official WTF IRC channel.
    Filed under: , ,
  • 03-23-2008 2:34 PM In reply to

    Re: I think I want to cry - Javascript linking

    boolean:

    Take a look at this piece of work: http://thinkswedish.com.

     

    I see ... a blank dark screen.  

    Not quite what I normally picture when I think of swedish. Close enough.

    There are three kinds of people: those who make things happen, those who watch things happen and those who wonder what happened.
  • 03-23-2008 4:34 PM In reply to

    Re: I think I want to cry - Javascript linking

    stinch:
    I guess working out how to hide the html when flash is present was too difficult.

    The de-facto standard is to use Javascript to embed Flash (due to changes in IE to avoid paying Eolas), and swfobject is the most common way to do it. It's built specifically to be able to gracefully degrade Flash content—you give it where your regular, friendly HTML content is, and swfobject replaces it with Flash if both Javascript and Flash are enabled.

    Ironically, they're already using swfobject, meaning that bringing the content back into the viewable area and changing one line of Javascript would allow non-Flash users to see the site without breaking the Flash "experience." This type of disregard for semantics and accessibility really reflects poorly on a studio, regardless of how impressively they handle other aspects of web development.

  • 03-24-2008 7:02 PM In reply to

    Re: I think I want to cry - Javascript linking

    Weng:
    And god forbid you accidentally stray your mouse cursor over the right angle gap to get to a link that unfolded about 15 feet

    You know what I hate? Hrefs that get bigger when you hover over them.

    Inevitably, one of them ends up at the end of a line and just barely fits on the screen. You hover over it, and it expands (probably because it went bold), and wraps down to the next line.

    Now your mouse isn't over it, so it goes back to normal, and then your CSS engine figures out it would fit on the previous line!

    So it pops back up, under your mouse, where it activates the hover and expands and wraps to the next line...

  • 03-25-2008 11:13 AM In reply to

    • Nelle
    • Top 150 Contributor
    • Joined on 11-08-2007
    • graz.at.earth.milkyway.universe
    • Posts 192

    Re: I think I want to cry - Javascript linking

    boolean:

    I also cry when I see forms with this:
    <input type="button" onclick="document.forms[0].submit();" >

    Agh! There is a form element called "submit" that will do that automatically, and without Javascript!

     

    We have something similar:

    <a href="javascriptdocument.xxx.submit();">XXX</a>

    We do it to make sure that the user who posts the form, really has javascript, because the further steps depend on it.

  • 03-25-2008 11:34 AM In reply to

    Re: I think I want to cry - Javascript linking

    Nelle:
    We do it to make sure that the user who posts the form, really has javascript, because the further steps depend on it.
    There is something inherently wrong with your software.
    irc://irc.slashnet.org/#TDWTF
    [12:15:49] <Duplication_Prevention_Bot> Human test subjects are illegal! I didn't sign an EULA for this.


  • 03-25-2008 11:50 AM In reply to

    Re: I think I want to cry - Javascript linking

    Lingerance:
    Nelle:
    We do it to make sure that the user who posts the form, really has javascript, because the further steps depend on it.
    There is something inherently wrong with your software.

    I don't think there's necessarily anything wrong with requiring JS, but this is a really silly way to handle it.  You should check for JS capabilities and provide the user with an error page if JS is off. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.

    Bush^3 vs. /O(s|b)ama Bi(n La)?den/ -- YOU DECIDE!
  • 03-25-2008 11:54 AM In reply to

    Re: I think I want to cry - Javascript linking

    morbiuswilters:
    You should check for JS capabilities and provide the user with an error page if JS is off. 
     

    Nicer if you give them a nice simple version of your page instead while noting the experience could be enhanced by enabling JS. Same goes for flash.

    Filed under: , ,
  • 03-25-2008 11:57 AM In reply to

    • Nelle
    • Top 150 Contributor
    • Joined on 11-08-2007
    • graz.at.earth.milkyway.universe
    • Posts 192

    Re: I think I want to cry - Javascript linking

    morbiuswilters:
    You should check for JS capabilities and provide the user with an error page if JS is off. 
     

    We do that, but without the error page. Its just a nice banner on the top of the page that states "Javascript is not enabled! Please enable it in your browser preferences.".

    Its just that the user is suppose to see the content, but should not go further unless javascript is turned on. 

  • 03-25-2008 12:00 PM In reply to

    • Nelle
    • Top 150 Contributor
    • Joined on 11-08-2007
    • graz.at.earth.milkyway.universe
    • Posts 192

    Re: I think I want to cry - Javascript linking

    Lingerance:
    There is something inherently wrong with your software.
     

    On many levels.

    There are lots of TRWTF's (R)(TM) in the app, but IMHO requiring javascript is not one of them.

Page 1 of 1 (17 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems