English 中文(简体)
Javascrit 文件输入在 IE 中不工作
原标题:Javascript file input is not working in IE

我不能在IE有低于代码的工作。 它对Firefox和Chrome很管用。

任何人都可以帮助, 如何使这项功能在 IE 上发挥作用?

 function readURL(input) {
   if (input.files && input.files[0]) {
     var reader = new FileReader();

     reader.onload = function (e) {
        $( #img_prev )
                .attr( src , e.target.result)
                .width(160)
                .height(152);
    };

    reader.readAsDataURL(input.files[0]);
  }
}
最佳回答

我以前也有类似的问题。 FileReader 在 IE 中尚未支持 :

http://html5demos.com/" rel="nofollow" >http://html5demos.com/

如果您需要 IE 支持包含常规文件上传, 您可能需要修改您的解决方案 。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签