Jcrop和IE9图像文件未定义

Jcrop and IE9 Image File is Undefined

本文关键字:文件 未定义 图像 IE9 Jcrop      更新时间:2023-09-26

由于某种原因,IE9决定在Jcrop和从要上传的文件中获取数据方面存在问题。这条线:

var oFile = $('#image_file')[0].files[0];

我得到:Unable to get properly '0' of undefined or null reference

在一天结束时,我需要能够访问文件的属性…IE9似乎无法通过请求[0].files[0]

来运行

IE9没有这种特性,在IE10中引入了input type="file"files特性

我不熟悉Jcrop,但对于IE9-,有一个问题访问div与id image_file

我使用以下代码将图像加载到一个变量中:

 $('#image_file').change(function () {
                    var oFile = this.files[0];
          //...
    });