RSS ? Recent Blog Posts

Blogs ยป Archive for August 10th, 2007

Are your icons working for you?

by Alex Walker

Icons and infographics are so integral to all GUIs (OS’s and online) that, like the street signs outside your window, we hardly notice them, even when we’re using them. And that’s exactly the way it really should be. The first time we see one it should help explain a concept behind a menu item, button or link — perhaps with a shopping cart silhouette next to a purchase option or a disk next to the ’save’ option. After the first time, we then tend to use them as flags or landmarks to move around interfaces we are familiar with.

However, there are time when that imagery can work against what you’re trying to achieve. Sometimes it can be as simple as emphasizing the wrong part of an interaction. In an online shopping situation, do you mark the ‘BUY’ button with coins or bills — emphasizing what the user is losing — or do you associate the process with the shopping cart or bag, emphasizing what your user is gaining. We don’t have to bug the Amazon board room to know the answer to that one.

I saw another case in point today. About a month ago I installed a new Antispam …

 

Dealing with unqualified HREF values

by James Edwards

When I was building my extension for finding unused CSS rules, I needed a way of qualifying any href value into a complete URI. I needed this because I wanted it to support stylesheets inside IE conditional comments, but of course to Firefox these are just comments — I had to parse each comment node with a regular expression to extract what’s inside it, and therefore, the href value I got back was always just a string, not a property or a qualified path.

And it’s not the first time I’ve needed this ability, but in the past it’s been with predictable circumstances where I already know the domain name and path. But here those circumstances were not predictable — I needed a solution that would work for any domain name, any path, and any kind of href format (remembering that an href value could be any one of several formats):

  • relative: “test.css”
  • relative with directories: “foo/test.css”
  • relative from here: “./test.css”
  • relative from higher up the directory structure: “../../foo/test.css”
  • relative to the http root: “/test.css”
  • absolute: “http://www.sitepoint.com/test.css”
  • absolute with port: “http://www.sitepoint.com:80/test.css”
  • absolute with different protocol: “https://www.sitepoint.com/test.css”

When are HREFs qualified?

When we retrieve an href with JavaScript, the value that comes back has some cross-browser quirks. What mostly happens is …

 

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.