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 }