使用的jquery版本是jquery 1.7.1 单击上翻按钮时,它显示错误为Uncaught TypeError:非法调用
$('#upload').on('click',function(){
var form = new FormData();
form.append('fw_file',$("#fw_file")[0].files[0]);
$.ajax({
url: base_url+'fieldwork/savefieldwork',
cache: false,
contentType: false,
processData: false,
dataType: 'json',
type: 'POST',
data: form,
success: function(data){
}
});
<form action="" method="post" accept-charset="utf-8" name="fieldworkform" id="fieldworkform" enctype="multipart/form-data">
<input type="file" name="fw_file" id="fw_file">
<input type="button" value="Upload" name="fileupload" id="upload">
</form>