[英]Javascript .files[0] can use in ie8 ,9 ,10?
Javascript .files[0]
can use in ie8
, 9
, 10
? 的Javascript
.files[0]
可以在使用ie8
, 9
, 10
?
I tested my code (javascript get file size before upload) on modern browser. 我在现代浏览器上测试了我的代码(javascript在上传之前获取文件大小)。 it's work good.
很好
and not work on my ie7
. 而不是在我的
ie7
上工作。
I want to know .files[0]
are work in ie8
, 9
, 10
or not ? 我想知道
.files[0]
在工作ie8
, 9
, 10
与否?
If possible, could you please give me some browser and version that support Javascript .files[0]
如果可能的话,请您给我一些支持Javascript
.files[0]
浏览器和版本。
https://jsfiddle.net/gg1j970x/ https://jsfiddle.net/gg1j970x/
<script>
function test_fn() {
var xx_data = document.getElementById("xx");
var xx_data_file = xx_data.files[0];
var xx_data_file_size = xx_data_file.size;
alert("file size : " +xx_data_file_size+" kB");
};
</script>
interesting question, answer here - > https://developer.mozilla.org/en-US/docs/Web/API/Blob/size 有趣的问题,在这里回答-> https://developer.mozilla.org/en-US/docs/Web/API/Blob/size
also you need to change it to "bytes" alert("file size : " +xx_data_file_size+" bytes");
您还需要将其更改为“字节”
alert("file size : " +xx_data_file_size+" bytes");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.