[英]Jquery .submit() event to firing
HTML 的HTML
<form action="includes/photos.php" id="joinPhotoUploadForm" enctype="multipart/form-data">
<input type="file" name="file" id="file"><br>
</form>
Jquery jQuery的
$('div#photoCropContainer').click(function() {
$('input#file').trigger('click');
});
And 和
$(document).on('change','input#file', function() {
alert('ready to upload');
$('form#joinPhotoUploadForm').submit();
});
When someone clicks the Div@photoCropContainer it trigers a click on the file input, shows the popup and sends the file. 当有人单击Div @ photoCropContainer时,它将触发对文件输入的单击,显示弹出窗口并发送文件。 This works on FF & Chrome.
这适用于FF和Chrome。
On IE9 however I always get the popup but no other reply... 在IE9上,我总是会弹出窗口,但没有其他回复。
Can anyone give me any advise? 谁能给我任何建议?
thanks 谢谢
As I can see in IE9 console "access denied" on form submit line, thats why nothing works. 正如我在IE9控制台中看到的,在表单提交行上“访问被拒绝”那样,这就是为什么什么都不起作用的原因。 Look at this question ie javascript form submit with file input
看看这个问题, 即javascript表单提交与文件输入
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.