How to detect browser support for File Api and drag and drop with javascript

Here’s a bit of info for you crazy HTML5 kids. You’ll need to include the handy¬†Modernizr script for it to work.

var browserIsSupported = !!window.FileReader && Modernizr.draganddrop;
If you want see it in action, just visit stolencamerafinder ;)
I’ve tested this in Firefox 3.6, Chrome 10, IE8, Safari 5 and Opera 11. The only browsers from that list to support FileReader from the File API and the drag and drop events are FF and Chrome.
Let’s hope the other catch up soon…

5 thoughts on “How to detect browser support for File Api and drag and drop with javascript”

  1. The only browsers from that list to support FileReader from the File API and the drag and drop events if FF and Chrome.

    I’m not sure which is worse; that fact that you can’t spell “is”, or that fact that you’re trying to use it where “are” is required.

    Your loyal readership,
    etc, etc….

  2. Oh the shame. Thanks for letting me know.

    I thought you’d have something to say about using old versions of Firefox and IE.

    Er, I’ve just noticed I’ve written “Chorme 10″, hah, you didn’t spot that one!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">