Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

A error: files.item(0).getAsDataURL is not a function .

  • 2 个回答
  • 85 人有此问题
  • 1 次查看
  • 最后回复者为 cnuvasu

more options

getAsDataURL is a javascript ,It ‘s show a picture. In firefox 6,It's ok,but in firefox 7 ,have a error: files.item(0).getAsDataURL is not a function . who can help me ? thanks.

getAsDataURL is a javascript ,It ‘s show a picture. In firefox 6,It's ok,but in firefox 7 ,have a error: files.item(0).getAsDataURL is not a function . who can help me ? thanks.

所有回复 (2)

more options

The documentation says: The File interface's non-standard methods getAsBinary(), getAsDataURL(), and getAsText() have been removed as well as the non-standard properties fileName and fileSize. See:
https://developer.mozilla.org/en/Firefox_7_for_developers#DOM
https://developer.mozilla.org/en/DOM/File

more options

image preview working for me please find code......

var reader = new FileReader();

function preview(what) { if(jQuery.browser.msie || jQuery.browser.safari || jQuery.browser.chrome) { document.getElementById("preview-photo").src=what.value; return; } else{ // array with acceptable file types var accept = ["image/png","image/jpeg","image/jpg","image/gif"];

// if we accept the first selected file type if (accept.indexOf(what.files[0].type) > -1) { if(what.files && what.files[0]){ reader.readAsDataURL(what.files[0]); document.getElementById("preview-photo").src=reader.result; } } } }