Twipped / Kalendae

A javascript date picker that just works.
MIT License
1.99k stars 285 forks source link

IE7 Javascript Errors #41

Closed lucaspiller closed 12 years ago

lucaspiller commented 12 years ago

I understand that IE7 isn't supported, however I don't believe it is right that Kalendae throws Javascript errors (hence breaking any other Javascript on the page) when run on IE7. I think some sort of detection should be done to check whether the plugin is being run on an old version of IE (or other unsupported browser) and bail out if needs be.

Obviously with jQuery this is trivial with $.browser (I've done this in my own code that dynamically adds Kalendae to elements), however as the library has no deps I'm not quite sure of the best way in pure Javascript. To deal with old versions of IE this seems to do the trick at the top of the main function, however I'm not sure about other browsers:

if (typeof Element === "undefined") { return false; }