Tag Archives: Web Development

Why Degrade Gracefully?

I got thinking today, as I near roll out of an internal helpdesk app heavily using jQuery, why we bother to degrade our scripts so they work without javascript. I get it: some people have javascript disabled in their browser… but my question is this: so what?

Javascript is a core part of web experience today.  In fact, I’d say that, on the desktop in the full browser front, if your browser doesn’t support at least HTML 4, javascript, and CSS 2, you’re not playing with the right tools.  After all, we expect that people can parse HTML, why not expect that javascript is a pre-requisite for web usage?

javascript

Some of us go to great pains to make sure our sites work should a user have javascript disabled.  But I’m actually considering the opposite: hiding certain critical elements if you don’t have javascript enabled to ensure that each visitor is on an even playing field.  Wrapping submit buttons in jQuery’s append() method, submitting data on click(), and plentifully exchanging JSON data via AJAX throughout ought to properly cripple participation of those who opt out of script execution on my site.

It all comes down to this: if you want your site to reach the widest audience possible, you need to anticipate that the client may not allow you scripting capability.  Conversely, on our intranet, and maybe one day on my websites, I’m doing the opposite: if you want to use the site, you’ve got to enable javascript: if you don’t, well… your loss.

Tagged , , , ,

IE: Sucking Hard Since Version 5

This code (extracted from a javascript file) works in every major browser except IE (including IE8):

     $('a[rel*=fancybox]').fancybox({
          'frameWidth' : 500,
          'frameHeight' : 465,
          'hideOnContentClick' : false,
          'centerOnScroll' : true,
     });

This is the fix:

     $('a[rel*=fancybox]').fancybox({
          'frameWidth' : 500,
          'frameHeight' : 465,
          'hideOnContentClick' : false,
          'centerOnScroll' : true
     });

See the difference? Yeah, neither did I. The difference is the last comma in the argument list.

That’s 3 consecutive major versions of IE that have been absolutely crap.  Why anyone continues to use IE is beyond me.  IE: sucking hard since version 5.

Tagged , , , , , ,

EW.com is a Terrible Website, Continued

EW.com doesn’t work for me anymore in Opera. At least, not properly. In their “TV Watch” section, the comments are an inserted iframe that is built via javascript. This is the script that does it:

<script type="text/javascript">
var boardUnrounded = Math.random() * 10000000000;
var boardRounded = Math.floor(boardUnrounded);
var boardDisplayPath = "http://epoche.ew.com/articles/comments?article_key=20039591&brand_key=3&
article_title=Things+Fall+Apart&rand=" + boardRounded; // alert( boardDisplayPath );
document.write( '[iframe id="iframe" src="' + boardDisplayPath + '" width="0" height="0"' );
document.write( 'style="position: fixed; top: -1000px; left:-1000px;"' );
document.write( '][/iframe]' );
</script>

Notice how the alert() function commented out, but still there; some sloppy debugging left around for us. Notice how the comments are loaded dynamically. What is the purpose of this? Why the random number? Could it be to ensure refreshes on each page load? Either way, between document.write and the iframe, the page consistently renders around the comments, and then the comments come smashing in. Except in Opera, when they simple don’t show up at all.

There are also javascript errors by default in the normal page load, IE chokes on some ad code, and Opera modifies the javscript over and over to make it not crash, and their CSS is a mess. In short, the entire thing is ridiculous. I don’t understand why they chose such a complex and useless path to code. Certainly I’ve seen plenty of sites that do much more traffic that have not opted to make their code a complete mess like this.

EW.com is a disaster and is a total disappointment. I’ve renewed EW for the last time. I intend to explain to them exactly why I’m cancelling my subscription too.

It just goes to show that users really do pay attention to little details on your website, and in this case, they are going to lose a paying paper subscriber due to sloppy, pointless, poor web design.

Tagged , , ,

Look At Me, I Am Cool Because I Am Valid

I was playing around the other day on one of the many news sites I visit and there was an article about can’t-miss web site “footers.” So, I checked out these masterful designs and what did I find? Nearly all of them had “Valid XHTML” and “Valid CSS” links on them. Most, like my humble little blog, had fancy little 80×15 buttons too. And then it hit me – WHY!?

I am sick and tired of these buttons. Honestly, I don’t give a crap if your stupid homegrown blog is valid code, so long as it renders properly in my browser. I’m not using an accessibility application, and I wouldn’t stop visiting a site if it weren’t properly semanitcally marked up. I bet you very few external apps will choke if you enter a URL with an & instead of a properly escaped &. XML needs to be validated. HTML and XHTML don’t. HTML has survived because of so many browsers having such a capable quirks mode. Frankly, as of right now, I find the entire validation link concept obnoxious.

Slapping some tag on your page does nothing for your reader – if they truly have a screen reader or some such device, it will either work or not, no checking for a silly button. If the browser is a text-only browser such as Elinks, it will either render or not, but ironically, it will not display your stupid “Valid” buttons.

Furthermore, for almost every blog, validity is a product of dynamically build pages and feeds born from a database backend, and unless you are doing lots of checking, validity can be comprimised by invalid input, regardless of the quality of code.

OSNews v3 was written to render in virtually every browser, and to do so, it uses Eugenia’s mix of HTML 2 and HTML 3, a subset often called C-HTML. The code is just plain ugly, but it works. And it sure as hell isn’t valid.

Maybe it’s blasphemous for a web programmer to say such things, but the fact remains, bragging about or advertising your validity is pointless, and I think most of your readers have trained themselves to ignore it. Also, if your code works and renders properly, what difference does it make?

I’m sure people out there disagree and will tell me why I’m wrong. But in the meantime, I will be removing the buttons from my site the next time I edit my blog code. Pffft.

Tagged , , ,