最近在做文件上传,第一次上传之后,再次上传同样的文件,不会做出相应的事件处理:
解决方案:
当你把input的文件取出之后,使用replaceWith覆盖掉以前的input,这样就做到了刷新input
$("#fileAttach").replaceWith('<input type="file" name="file" id="fileAttach" accept="image/jpg,image/png" onchange="updataImg()" />');
最近在做文件上传,第一次上传之后,再次上传同样的文件,不会做出相应的事件处理:
解决方案:
当你把input的文件取出之后,使用replaceWith覆盖掉以前的input,这样就做到了刷新input
$("#fileAttach").replaceWith('<input type="file" name="file" id="fileAttach" accept="image/jpg,image/png" onchange="updataImg()" />');
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。