【问题标题】:How to implement HTML5 API features in older browser如何在旧版浏览器中实现 HTML5 API 功能
【发布时间】:2014-08-07 07:50:47
【问题描述】:

我正在使用新浏览器的功能(HTML5 API - files prop)以这种方式通过jquery获取上传文件的大小和类型。

$(function() {
    $('#myFile').bind('change', function() {
        //gets the size and the type of your file.
        var fsize = $('#myFile')[0].files[0].size; 
        var ftype = $('#myFile')[0].files[0].type; 
        alert("size : " + fsize + " type : " + ftype);
    });
});

我想知道是否可以使用外部库(Modernizr、html5shim 等)来实现这些功能 即使在较旧的浏览器上,例如 IE8。

谢谢。

【问题讨论】:

    标签: html


    【解决方案1】:

    旧版浏览器不支持 HTML5,因此无法实现这些功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-17
      • 2020-06-26
      • 1970-01-01
      • 2013-04-09
      相关资源
      最近更新 更多