标签:complete mil for otto bin eclips inf put 附件


<!-- 导入jquery核心类库 -->
<script type="text/javascript" src="/bos_management/js/jquery-1.8.3.js"></script>
<!-- 导入ocupload核心类库 -->
<script type="text/javascript" src="/bos_management/js/jquery.ocupload-1.1.2.js"></script><!-- 导入jquery核心类库 --><script type="text/javascript" src="/bos_management/js/jquery-1.8.3.js"></script><!-- 导入ocupload核心类库 --><script type="text/javascript" src="/bos_management/js/jquery.ocupload-1.1.2.js"></script>$("#button-import").upload({
//文件上传的路径
action: ‘/bos_management/area_batchImport‘,
onSelect: function() {
//选择文件后,关闭自动提交
this.autoSubmit = false;
//获得文件名
var filename = this.filename();
//判断文件格式
var regex = /^.*\.(xls|xlsx)$/;
if(regex.test(filename)) {
this.submit();
} else {
$.messager.alert("警告", "请选择后缀名为xls或xlsx的文件", "warning");
}
},
//回调函数
onComplete: function(response) {
window.location.href = "/bos_management/pages/base/area.html";
}
});$("#button-import").upload({ //文件上传的路径 action: ‘/bos_management/area_batchImport‘, onSelect: function() { //选择文件后,关闭自动提交 this.autoSubmit = false; //获得文件名 var filename = this.filename(); //判断文件格式 var regex = /^.*\.(xls|xlsx)$/; if(regex.test(filename)) { this.submit(); } else { $.messager.alert("警告", "请选择后缀名为xls或xlsx的文件", "warning"); } }, //回调函数 onComplete: function(response) { window.location.href = "/bos_management/pages/base/area.html"; }});
标签:complete mil for otto bin eclips inf put 附件
原文地址:https://www.cnblogs.com/zhaoxuan734/p/8745834.html