Jquery .submit()事件触发 [英] Jquery .submit() event to firing
本文介绍了Jquery .submit()事件触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HTML
<form action="includes/photos.php" id="joinPhotoUploadForm" enctype="multipart/form-data">
<input type="file" name="file" id="file"><br>
</form>
Jquery
$('div#photoCropContainer').click(function() {
$('input#file').trigger('click');
});
和
$(document).on('change','input#file', function() {
alert('ready to upload');
$('form#joinPhotoUploadForm').submit();
});
当有人点击Div @ photoCropContainer时,它会触发对文件输入的点击,显示弹出窗口文件。这对FF& Chrome。
When someone clicks the Div@photoCropContainer it trigers a click on the file input, shows the popup and sends the file. This works on FF & Chrome.
在IE9上,我总是得到弹出窗口,但没有其他回复...
On IE9 however I always get the popup but no other reply...
感谢
推荐答案
IE9控制台访问被拒绝在表单提交行,这就是为什么没有工作。查看此问题即通过文件输入提交JavaScript表单
As I can see in IE9 console "access denied" on form submit line, thats why nothing works. Look at this question ie javascript form submit with file input
这篇关于Jquery .submit()事件触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文