Forms IE8使用jquery和单击触发器提交上传表单

Forms IE8使用jquery和单击触发器提交上传表单,forms,internet-explorer-8,upload,triggers,Forms,Internet Explorer 8,Upload,Triggers,有人能告诉我为什么这段代码在IE8中不起作用,但在IE8+和其他所有代码中都起作用 <form action="upload.php" method="get" enctype="multipart/form-data" id="upload-form"> <input type="file" name="upload_file" id="upload-file"> </form> <button id="choose

有人能告诉我为什么这段代码在IE8中不起作用,但在IE8+和其他所有代码中都起作用

<form action="upload.php" method="get" enctype="multipart/form-data" id="upload-form">
    <input type="file" name="upload_file" id="upload-file">
</form>              
<button id="chooseFile">Choose file</button>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
    jQuery(function($){

        $('#chooseFile').on('click', function(e){
            //$('#upload-form').submit(); //this fire when choose file
            $('#upload-file').trigger('click'); //this fire event below successfully
            return false;
        });

        $('#upload-file').on('change', function () {
            alert(1); //alert is firing in IE8 so event fire
            $(this).parent().submit(); //this not work in IE8
            $('#upload-form').submit(); //this also not work in IE8 
            return false;

        });
    });
</script>

选择文件
jQuery(函数($){
$('#chooseFile')。在('单击')上,函数(e){
//$(“#上传表单”).submit();//选择文件时将触发此事件
$(“#上传文件”).trigger('click');//下面的火灾事件成功
返回false;
});
$('#上载文件')。在('change',函数()上{
警报(1);//警报在IE8中触发,因此事件触发
$(this.parent().submit();//这在IE8中不起作用
$(“#上传表单”).submit();//这在IE8中也不起作用
返回false;
});
});
我只想在更改事件中单击#选择文件btn后提交表单


请帮助

我遇到了一个类似的问题(),您找到解决方案了吗?我还没有找到解决方案。。。