是datatype的问题,指定为text好了

$(function() {
            $("#submitbtn").click(function() {
                var file = $("#file_upload").val();                                
                if (file == '') {
                    alert("上传模版不能为空");
                    return false;
                } 
                $.ajaxFileUpload({
                       url: "${pageContext.request.contextPath}/inventoryController/importinventory.form",
                       type:"post",
                       fileElementId: 'file_upload',
                       dataType: 'text',
                       success: function (data) {
                             alert(data);                             
                             /* if(data=='字段'){
                                alert('清单导入成功!');
                                location.reload();
                            }else{
                                alert('清单导入失败,请检查文件');
                            }  */
                        },
                        error: function (data, status, e) {                            
                            alert('回调失败');
                        }
                    });
            });
        });

 

相关文章:

  • 2021-11-20
  • 2021-09-25
  • 2021-07-14
  • 2021-09-25
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
猜你喜欢
  • 2021-06-09
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2021-05-02
相关资源
相似解决方案