使用 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

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.的更多相关文章

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

    今天上传图片遇到这个报错 百度了下,网上说是input标签type=file所以导致的问题,可是我的type=hidden 解决办法: 把上面的代码改成如下问题就解决了

  2. select2取值报错,Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('hidden') does not support selection.

    用到了 select2 组件来多选收件人,用搜狗浏览器(6.2版高速模式)在执行到如下这句时报错(Uncaught InvalidStateError: Failed to read the 'sel ...

  3. angularjs Failed to read the 'selectionStart' property from 'HTMLInputElement':

    在找angularjs input(type='number')在获取焦点的时候,文本框内容选中效果,参考了:Select text on input focus,我直接复制他的code之后,在ion ...

  4. angularjs 1 Failed to read the 'selectionStart' property from 'HTMLInputElement':

    在找angularjs input(type='number')在获取焦点的时候,文本框内容选中效果,参考了:Select text on input focus,我直接复制他的code之后,在ion ...

  5. vue引入fastclick设置输入框type="number"报错Failed to execute 'setSelectionRange' on 'HTMLInputElement': The input element's type ('number') does not support selection.的解决办法

    将输入框type设为text,通过正则验证输入的值

  6. Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

    canvas绘制图片,由于浏览器的安全考虑,如果在使用canvas绘图的过程中,使用到了外域的图片资源,那么在toDataURL()时会抛出安全异常: Uncaught SecurityError: ...

  7. Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...

  8. Uncaught DOMException: Failed to construct 'WebSocket': The URL 'xxx.xxx.com/' is invalid.

    Uncaught DOMException: Failed to construct 'WebSocket': The URL 'xxx.xxx.com/' is invalid. 出现这个问题是构造 ...

  9. wordpress 点击文章图片 不能编辑(chrome下面) wordpress Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.

    说明:在chrome下面,编辑文章插入的图片,点击到图片上面,没有菜单显示. 报错: tinymce.min.js:10 Uncaught DOMException: Failed to execut ...

随机推荐

  1. 资源从3ds max导入UE4问题

    1.先删掉灯光和相机.材质命名为英文,贴图也要英文取名,不能有中文,并且必须是JPG格式.并整理好组:删掉多余的物体,例如线2.坐标归零.并把材质转换为默认材质3.选中一个组,先unground,然后 ...

  2. 关于 extern "C"的说明

    在用C++的项目源码中,经常会不可避免的会看到下面的代码 #ifdef __cplusplus extern "C" { #endif /*...*/ #ifdef __cplus ...

  3. .NET项目引用黄色小三角以及找不到依赖的解决方法

    上图,问题描述: 经过查证,这个是引用的项目框架版本和本项目框架版本不一致的症状. 解决办法: 点击项目右键属性,调整版本使两个项目的版本一致 问题解决.good! ----------------- ...

  4. 【贪心】经营与开发 @upc_exam_5500

    目录 经营与开发 @upc_exam_5500 PROBLEM 题目描述 输入 输出 样例输入 样例输出 提示 SOLUTION CODE 经营与开发 @upc_exam_5500 PROBLEM 题 ...

  5. JAVA自学笔记25

    JAVA自学笔记25 1.GUI 1)图形用户接口,以图形的方式,来显示计算机操作的界面,更方便更直观 2)CLI 命令行用户接口,就是常见的Dos,操作不直观 3) 类Dimension 类内封装单 ...

  6. JSOUP 超时分析与处理

    JSOUP 超时分析与处理 下面说说超时的发现,有可能出现超时的原因,以及超时处理. 1.请求头信息得一致 当你捕获到一个采用JSOUP 去请求超时的链接,我是通过catch 去发现. try{ do ...

  7. golang的dlv调试工具print打印字符串显示more,无法显示更多

    使用dlv (delve golang调试器)打印字符串无法打印全,只能打印一部分(64个字节),在gdb中有 (gdb) set print elements Argument required ( ...

  8. hadoop2.7.3编译,支持snappy、bzip2本地压缩

    软件包: apache-ant-1.9.9-bin.tar.gz apache-maven-3.3.9-bin.tar.gz apache-tomcat-6.0.44.tar.gz CentOS-6. ...

  9. 运行VsCode缺少libxss.so.1

    安装libXScrnSaver即可 yum install libXScrnSaver     使用的时候出现一个错误 bash: /usr/local/bin/rar: /lib/ld-linux. ...

  10. C# CountdownEvent实现

    关于CountdownEvent网上的介绍比较少,因为它是实现和使用都很简单,先看看网上的一些评论吧: CountDownEvent调用成员函数Wait()将阻塞,直至成员函数Signal() 被调用 ...