我找不到检测如果浏览器支持
File API通过
.support
在jQuery中的方式.
@H_403_2@有人知道吗
@H_403_2@(顺便提一句:用IE检测输入[type = file]文件的大小的方法)
解决方法
它似乎没有在jQuery中实现,但你可以检查一下自己:
http://jsfiddle.net/pimvdb/RCz3s/.
@H_403_2@< input type ='file'>的文件属性如果实现了它,返回一个空的FileList,否则它不被定义(即它是未定义的).
var support = (function(undefined) { return $("<input type='file'>") // create test element .get(0) // get native element .files !== undefined; // check whether files property is not undefined })();