亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - The file selection pop-up window cannot be called up in the callback function
給我你的懷抱
給我你的懷抱 2017-05-19 10:39:48
0
2
736

HTML

<input id="videoInput" type="file" style="display: none" />
<button type="submit" id="videoUploadInput">上傳文件</button>

JS

$('#videoUploadInput').click(function (e) {
  e.preventDefault()
  setTimeout(function() {
     document.getElementById('videoInput').click()
  }, 2000)
})

The initial positioning reason is that the click event is triggered by the callback function. At this time, event.isTrusted is false (this attribute is currently only supported in IE and Firefox), rather than being actively triggered by the user, that is, this event is not Trusted by the browser.

給我你的懷抱
給我你的懷抱

reply all(2)
給我你的懷抱

http://stackoverflow.com/ques...

http://stackoverflow.com/ques...

僅有的幸福

1. Change the delayed 2000 to 1000

Link description

2. Delayed processing functions are executed immediately

setTimeout((function(){})(),2000)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template