How can I check if the browser support HTML5 file upload (FormData object)?

后端 未结 7 1926
离开以前
离开以前 2020-12-08 04:38

How can I check if the browser support HTML5 file upload (FormData object)?

var fd = new FormData();

Following the answer from this post, b

相关标签:
7条回答
  • 2020-12-08 05:27

    This is the one-liner I use to check if the browser supports FormData and upload progress, in jQuery:

     var xhr2 = !! ( window.FormData && ("upload" in ($.ajaxSettings.xhr()) );
    
    0 讨论(0)
提交回复
热议问题