最近在做文件上傳,第一次上傳之后,再次上傳同樣的文件,不會做出相應的事件處理:
解決方案:
當你把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刪除。