javascript - What is the best way to check for XHR2 file upload support? -


if xhr2 supported file-upload capabilites, application needs different preparation. safe way check if these capabilities supported. sufficient, example, check xmlhttprequest (or ms equivalents) upload property? like...

var xhr = new xmlhttprequest(); if (typeof xhr.upload !== "undefined") {   nice stuff } else {   oldschool stuff } 

or not safe?

if (new xmlhttprequest().upload) {   // welcome home! } else {   // not supported } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -