Via my friend Dave, please enjoy Never Said About Restaurant Websites, a hilarious, sarcastic, and utterly accurate list of what far too many restaurant websites do horribly, horribly wrong.
13 December 2010
Head JS
Head JS is a marvelous thing. 2.3K when gzipped, and look at all it does: screen width detection (with CSS support), HTML5 element injection (like Modernizr), parallel script downloading with serial execution… I haven’t checked how well it does performance-wise, but I hope it’s decent, because I kind of want to start using it everywhere.
Posted in CSS, HTML5, JavaScript | No Comments »
7 December 2010
CSS Cards v1.1
Anika over at selfthinker gave me a shout-out for my CSS Deck of Cards. She’d developed a deck of her own and was analyzing alternatives.
She (correctly) pointed out that my deck offered nothing for accessibility. Admittedly, my original design wasn’t aiming for accessibility — rather, I just wanted to see if I could do an entire deck with just CSS and nothing in the markup. But to address her concerns, I’ve just released v1.1 of the deck, which now allows accessibility as an option. The layout is still off in Chrome, but that’s getting fixed in v1.2.
Posted in CSS | No Comments »
11 November 2010
News Flash
I wish I could say this was a surprise: of the security issues that Apple patched in Mac OS X 10.6.5, 42% were to deal with Adobe Flash.
The security issues related to Flash are in fact the stated reason why Apple is backing away from bundling the plugin with its new computers. Apple began shipping the MacBook Air without Flash installed, noting that customers could install the plugin on their own to ensure they had the latest, most secure version.
However, testing indicates that in normal operation, Flash can also consume dramatic amounts of battery life just to animate web ads in the background, resulting in as much as two hours of lost productivity on a single charge.
Posted in Misc | No Comments »
3 November 2010
Bad ATM UI
I used to do UI development full-time, and it’s still a significant portion of my job. So I tend to be aware of bad interfaces more than most people. Here’s a fine example – not from the Web, but informed by it. The ATM I used this morning:
Beveled buttons with cool gradients are all the rage on the Web nowadays, which is clearly why the designers of this Diebold ATM interface went with them. The problem? This is not a touch-screen interface! You can’t touch those zones; you’re supposed to use the mechanical buttons sitting next to them.
A beveled zone signifies “click here” on the Web, or “touch here” on a touch-screen, so I kept touching the screen as I navigated through this interface. The designers should have gone with a non-beveled zone instead, ideally with an arrowhead pointing to the mechanical button associated with that zone.
Posted in UI | 2 Comments »
14 October 2010
Graceful Degradation
I’ve been working lately on an app that will only be used in-house, so we can simply exclude browsers that we don’t wish to support. Moreover, there is no business- or marketing-driven reason to insist on a fully-polished UI that looks the same across the board. The result? Graceful degradation in IE 7 and 8. IE users get square corners and no drop shadow? Big whoop. IE’s interface looks boxy and lumpy? Oh well.
Man, this is a freaking joy. There’s simple, clean CSS3 all over the place. How I look forward to the day when IE9 has broad support and I can start doing this kind of thing on lots of public sites as well. Sadly, Microsoft has announced that IE9 won’t run on Windows XP, which is currently about half of the Windows installs out there, so IE8 looks to be the “IE6 of the future”.
Posted in Browsers | No Comments »
30 September 2010
Cross-browser JavaScript
I’ve been working on an internal project lately where I am the only presentation-tier developer, which is not unusual here. What is unusual is that the application is lots of JavaScript and Ajax; most of our stuff leans far more heavily on server-side Java.
There are certainly still differences in browser implementations; heck, dealing with cross-browser CSS is a lot of What I Do™. And there are certainly differences with JavaScript methods as well. However, the brand-name JavaScript libraries exist, in part, to flatten out and deal with the latter. If you’re using one of those libraries, you can rely on it to account for those differences under its hood.
Thus it was with some surprise that I saw a code check-in yesterday that added client-side browser sniffing… and if you were on anything other than IE, would prohibit you from logging in.
After cleaning up the pile of exclamation points that streamed forward from my eyeballs and littered my desk, I began investigating. It seems that in developing the app, the team had hit a few points where IE and Firefox were behaving differently with regards to JavaScript. The team was concerned that having to do cross-browser development would add lots of development time, and since this is an internal project (and thus we can dictate what browsers are permitted), the team decided to settle on one browser, picking IE.
I feel pretty strongly about browser agnosticism, and also feel pretty strongly that browser-sniffing code is inevitably fragile and tricky (I prefer “duck-typing” based on feature). More importantly, I argued, while there are browser differences with JS, if you’re using a library (which we are, namely jQuery), those things don’t tend to come into play unless you’re dealing with something complicated. If you’re coding up Google Maps, sure — but our application is fairly modest and not at all bleeding-edge. The browser differences we were encountering involve straightforward features, the kinds of things that the libraries should be accounting for… so this suggested there’s an underlying, deeper problem. Blocking a browser to avoid these issues would just be putting a band-aid on a deep wound.
Sure enough, the problems were easily remedied. In one instance, the code was checking to see if a form field was enabled by seeing if the field had a value of “enabled”. The issue? The code should be checking for a boolean of true or false, not a string value of “enabled”. One of the browsers would let you get away with this; the other would not. Changing the code to check for a boolean solved the problem. In another case, updates to a page were showing up in Firefox but not IE. IE, it turns out, was caching Ajax data; a jQuery setting of "$.ajaxSetup({ cache: false });" took care of it.
Once we checked in with the business owner about browser preferences, fighting for browser agnosticism turned out to be the right thing to do. We learned that half the user base for this application uses Firefox, and we’d really have annoyed them if we’d forced them to use IE for this application. The browser-sniffing code got removed today, as did the prohibition on non-IE users. Glad I took a stand!
The lessons here:
- Use a JS library, and take advantage of its features often. Let it deal with the annoying browser issues.
- If you’re using a library and encounter a cross-browser JavaScript problem, more often than not this suggests an issue with your code, not the browsers.
Posted in Browsers, JavaScript | No Comments »
26 August 2010
IE6 and Mobile Sites
IE6 turns nine years old tomorrow. Ironically, it’s now old enough to ride most rides… and those rides are turning it away. The latest is PBworks, formerly PBwiki. They’ve announced that IE6 users are about to start getting a warning message that they have two months to upgrade.
Here’s the intriguing part: after that date, they will be directing IE6 users to their mobile site. And that, I admit, is a solution I hadn’t considered. Most mobile browsers, after all, have stronger standards support (and better security) than IE6. But most mobile sites also offer stripped-back functionality, making them frequently compatible with IE6′s limited standards. If your mobile site has scaled-back features, and those features aren’t especially demanding on modern browser features, punting your IE6 users to m.yoursite.com can be a great way to get rid of headaches.
Posted in Browsers, IE6, Mobile | No Comments »
21 July 2010
Here Is Why Web Developers Hate IE6
This humorous graphic speaks 1000 words.
Posted in IE6 | No Comments »
1 July 2010
Flash In the Pan
IE9 has announced they’re giving decent support to the <video> tag. And that, my friends, spells the beginning of the end for Flash.
I’m a Web-standards guy, so my inclination has never been toward Flash anyway. Admittedly, there are some things for which Flash is ideally suited — namely, for animation and video. To date, there really hasn’t been a reliable way to do that kind of thing, other than the fairly ubiquitous Flash plug-in.
My big beefs with Flash, though, are:
- it doesn’t play well with others. CSS z-indexing is tricky. It also steals keyboard focus, preventing Tab and (on Windows) Alt-Tab from working normally.
- that designers use it for things like site navigation and to display text, be that out of a control-freaky desire to control all things related to the user experience, or out of a lazy refusal to learn how to do such things in DHTML/CSS.
The latter has become a real issue now that I have an iPhone. Sites with Flash splash pages, but no HTML “skip this” link, prevent me from seeing their site. Sites done up entirely in Flash, as is very common for musicians and artists, prevent me from seeing anything. Recently, while driving, my wife and I thought about visiting a new restaurant nearby, so we called up their site to see their menu. The site was all Flash. That restaurant lost business that day — and we still haven’t eaten there. If you can’t be bothered to give me your menu in HTML — a text medium! — I can’t be bothered to find ways around the all-too-familiar iPhone brick icon.
Now, when I mention the iPhone, neither here am I defending Steve Jobs. On the one hand, his public position that the iPhone wants to support HTML5 over proprietary standards is a good one. His refusal to allow Adobe’s tools to export into an iPhone-friendly format, insisting that iPhone developers use only Apple-endorsed tools, shows his real motives.
But Jobs is right about one thing: HTML5 is a big win. With it, we get video, audio, and lots of other good stuff that, to date, has required us to use Flash. IE has, as always, been the laggard; that IE9 will support these HTML5 technologies is a big win for the Web. Mind you, it’ll be years and years before IE6-8 have been suitably flushed out of our system, but we’ll at least be able to plan for the future.
HTML5 doesn’t do everything that Flash can, as Ajaxian points out. Flash will do full-screen video, for instance, which none of the browsers will currently do for HTML5 video. That, however, is a problem for the browser makers, not a problem with HTML5. Hop to it, ye browser coders!
Posted in Browsers | No Comments »
