Skip to content

24 ways to impress your friends

Vote down?

Randy

I like the idea of cleanly putting all your CSS hacks in separate files and using Javascript to load them up. I agree that it sucks to do browser sniffing, but these days you have to because even testing if a browser supports a method doesn’t cut it, because it might support it incorrectly!

I found this site to be a real eye opener;
http://webbugtrack.blogspot.com/search/label/DOM%20Methods

For almost every method available in the DOM, there is at least one browser that doesn’t support it correctly, and 90% of the time that browser has a blue e icon.

I’m thinking of applying your logic to load up custom libraries for each browser rather than have to test everytime I execute a function, if browser a, do this, else if browser b do that.

Something like:
baselib.js
//conditional loads, based on browser detection
ie.js
opera.js
safari.js

(but I might split out the ie.js because between IE6 and IE7 there are a tonne of differences too)

thanks
randy