javascript

Mootools

05 Nov 2009
Posted by cgp

Ok, so the moral of the story here is this: Don’t determine what version a browser is based on the methods available. I don’t think I was clear about this in the past because I’ve never implemented it myself. What you’re supposed to do is detect whether or not the native functionality exists, if it does, then use it. If not, then either recreate it the functionality or raise an exception (unsupported).

I always thought testing the capability of the browser (instead of using browser version strings) meant conditions like this all over the place before you used the function: