【发布时间】:2015-04-03 05:34:04
【问题描述】:
所以我遵循了一些异步上传文件的教程。该项目在 Mozilla Firefox 和 Chrome 上运行良好,但是当我在 Internet Explorer 9 中运行它时出现错误:
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'length': object is null or undefined
这里是显示错误的地方:
<script type="text/javascript">
$(document).ready(function () {
$("#btnUpload").click(OnUpload);
});
function OnUpload(evt) {
var files = $("#fileUpload").get(0).files;
if (files.length > 0) { <---//Error
...
我已经尝试了一些修复,例如将其添加到 head 标签中
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9" >
这对我不起作用。 因此,我们将不胜感激。
【问题讨论】:
-
stackoverflow.com/q/14845895/3639582
不支持文件 API
标签: javascript jquery html asp.net internet-explorer-9