javascript - How to detect a browser that will not support XHR2 Upload progress -


few android browsers including samsung default browsers on older devices not support

xhr.upload.onprogress 

event. cannot show realtime upload progress on browsers.

how can detect browsers? can change setup show progress.

simply :

var xhr = new xmlhttprequest(); if ( xhr && ('upload' in xhr) && ('onprogress' in xhr.upload) ) // attach event... 

so if want function :

function supportajaxuploadprogressevents() {   var xhr = new xmlhttprequest();   return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload)); } 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -