I think I want to cry - Javascript linking


  • Discourse touched me in a no-no place

    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.



  •  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.


  • Discourse touched me in a no-no place

    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.



  • @Weng said:

    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 said:
    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.


  • Discourse touched me in a no-no place

    @boolean said:

    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.



  • @Weng said:

    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.



  • @Weng said:

    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 said:

    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.



  • @boolean said:

    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?



  • @boolean said:

    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.



  • @stinch said:

    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.



  • @Weng said:

    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...



  • @boolean said:

    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="javascript:document.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.



  • @Nelle said:

    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.



  • @Lingerance said:

    @Nelle said:
    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. 



  • @morbiuswilters said:

    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.



  • @morbiuswilters said:

    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. 



  • @Lingerance said:

    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.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.