[英]Trigger file input dialog programatically on iOS 6
How can I trigger a select file dialog on iOS 6 for an input element in the DOM programatically? 如何在iOS 6上以编程方式触发DOM中输入元素的选择文件对话框? (ie using Javascript) (即使用Javascript)
<input type="file" id="foo">
Notes: 笔记:
document.querySelector("input[type=file]").click()
in safari. 我使用safari中的document.querySelector("input[type=file]").click()
使它正常工作。 After some more research it seems like this isn't possible. 经过更多研究后,看来这是不可能的。 Least I haven't found a method that works. 至少我还没有找到一种有效的方法。
I decided to solve this using an <input type='file'>
positioned on top of the button, with opacity 0.01 to make the button visible. 我决定使用位于按钮顶部的<input type='file'>
(不透明度0.01)使按钮可见来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.