Uncaught InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.


使用 HTML5 的图片上传api的时候报如下错误:

Uncaught InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.

 出现这个bug的原因是,input元素 blur的时候,需要将上次图片的input元素的value设置为空字符串,就不会报错了。

http://stackoverflow.com/questions/29720794/jquery-select-input-file-and-also-set-it-to-another-input


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 Gradle sync failed: Cannot set the value of read-only property 'outputFile' 前端:Uncaught TypeError: Cannot set property 'value' of null; element 上传组件Uncaught TypeError: Cannot set property ‘status‘ of undefined 的原因和解决办法 Uncaught TypeError: Cannot set property 'innerHTML' of undefined JavaScript Uncaught TypeError: Cannot read property 'value' of null Uncaught TypeError: Cannot set property ‘display‘ of undefined解决 Uncaught DOMException: Failed to read the 'localStorage' property from 'Window' 出错:Failed to convert property value of type 'org.apache.ibatis.session.defaults.DefaultSqlSessionFactory' to required type 'java.lang.String' for property 'sqlSessionFactoryBeanName'; Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#' Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#'
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM