简体   繁体   English

更改事件未在IE中首次触发

[英]change event not firing in IE for the first time

$(this).find('.custom-file-input').trigger('click');
$(this).find(".custom-file-input").off().on('change', function (){
....
}

Above is my code snippet, I am trying to trigger the click of a file upload input, which opens the file open dialog and then on change, I am trying to execute some code. 上面是我的代码段,我试图触发文件上传输入的单击,这将打开文件打开对话框,然后在更改时,我试图执行一些代码。 In IE, for the first time, It doesn't work. 在IE中,这是第一次,它不起作用。

While in chrome and firefox, its working with success every time. 在chrome和firefox中,每次都能成功运行。

did you try changing the order? 您是否尝试过更改订单?

$(this).find(".custom-file-input").on('change', function (){
....
}
$(this).find('.custom-file-input').trigger('click');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM