Skip to content

24 ways to impress your friends

Vote down?

Brian LePore

@Dustin: You’re right, it is clear that that is what you’re attempting to do, I just see it as some users may actually use features in their browsers, and it isn’t our fault that they would like to do so. Sure there are some features we shouldn’t code for (for example, we shouldn’t assume that they are using Firefox and have an extension that will do something), but those are rare cases. As it stands, this is probably one of the niftiest style sheet switcher I’ve seen, so I love it.

That said, I am by no means an expert JavaScripter as I’ve only been toying around with it for a short time, but to me it looks like you are cancelling the click event before you test whether or not the browser has Ajax ability. Does this not run on any browser that can’t support Prototype (I haven’t looked into Prototype to thorougly yet), and it’s just chance that all browsers that are supported by Prototype must have Ajax?

Shouldn’t we be developing for users without JavaScript, then for users with JavaScript but not Ajax, and then Ajax versions? This hits the non-JavaScript users and the Ajax people, but does nothing for people with JavaScript but not Ajax. If the click event was not cancelled, then non-Ajax JavaScript enabled users would fall back to non-JavaScript version. Is that too sharp a fall to degrade them that much? Should it then fall into another branch of code that makes it similar to your average client side style sheet switcher? If that branch is present, isn’t Ajax overkill? This question holds true for every Ajax application. Is this one of those times?

I don’t really have an answer for that (and since it’s 4:52 AM as I write this, I don’t know if that answer would even make sense), but I think it gives us something to ponder.