日期:2014-05-16 浏览次数:20361 次
<script type="text/javascript">
$(function () {
var uploadCatlog;
//设置母版页导航栏的当前选中样式
$("#menu .nav5").addClass("menu_active").siblings().removeClass("menu_active");
//生成类别菜单样式和导航菜单
$("#kllst li").click(function () {
$(this).addClass("currentli").siblings().removeClass();
uploadCatlog = $(this).text();
});
var btnUpload = $('#upload');
var status = $('#status');
btnUpload.click(function () {
if (uploadCatlog == undefined) {
status.text("必须先选择上传文件的类别!").addClass('error');
return false;
}
new AjaxUpload(btnUpload, {
action: 'handler/doUpload.ashx',
name: 'uploadfile',
onSubmit: function (file, ext) {
if (!(ext && /^(doc|docx|xls)$/.test(ext))) {
status.text('只支持WORD,EXCEL格式上传!').addClass('error');
return false;
}
status.text('正在上传,请稍候...');
},
data: { "catlog": uploadCatlog },
onComplete: function (file, response) {
status.