嗨Html5开发人员和HTML4开发人员......
我想知道是否有任何方法支持IE8及以上版本的html5的window.fileReader API.
代码如下:
if(window.fileReader){
alert("supported"); // in html5 works and fires alert but not in IE8
}
Run Code Online (Sandbox Code Playgroud)
实际上,我想在提交之前阅读文件的内容.
等待回复..
您需要检查以下内容的多个部分:
//Full File API support.
if ( window.FileReader && window.File && window.FileList && window.Blob )
{
//Supported
}
else alert( "Not supported" );
Run Code Online (Sandbox Code Playgroud)
你的第二个要求:
我也想知道在不使用HTML5 fileAPI但不使用ActiveXObject的情况下读取文件内容的方法.
你能做的是:
document.getElementById( "myForm" ).target = "myIframe"; document.getElementById( "myForm" ).submit();<script>window.parent.someCallbackFunction( theFileCOntents );</script>)| 归档时间: |
|
| 查看次数: |
13976 次 |
| 最近记录: |