此代码可以在Firefox上运行,但不能在Mac/iOS Safari上运行。有没有办法让它工作呢?
$(function(){ setTimeout(function(){ $("input[name='upload']").trigger('click'); },1000); });
发布于 2019-01-28 11:33:06
显然这是被禁止的。可能是在安全方面。https://mariusschulz.com/blog/programmatically-opening-a-file-dialog-with-javascript
https://stackoverflow.com/questions/54374463
相似问题