添加了后台的申请表上传和前台申请表上传控件的通用操作JS

This commit is contained in:
Li Jianxuan 2013-09-05 01:46:26 +00:00
parent 7c131daf89
commit dc7be636fa
2 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,37 @@
var uploader;
var param;
$(function() {
$('#file_upload').uploadify({
'swf' : '/js/lib/uploadify/uploadify.swf',
'uploader' : '/admin/down/uploadapplicationform',
'multi' : false,
'auto' : true,
'fileTypeExts' : '*.pdf',
'onUploadSuccess' : function(file, data, response) {
upload.onsuccess(file, data, response);
},
'onUploadStart' : function(file) {
$('#file_upload').uploadify('settings','formData',param);
}
});
});
var upload = {
onsuccess : function(file, data, response){
_data = $.parseJSON(data);
if(!$.isEmptyObject(_data.error))
{
alert(_data.error);
}else{
$('#upload-form').modal('hide');
window.location = window.location;
}
},
showUploadForm : function(id){
$('#upload-form').modal('show');
param = {
"PHPSESSID" : _this.SessionID,
'orderid' : id
};
}
};

View File

@ -0,0 +1,38 @@
var uploader;
var param;
$(function() {
$('#file_upload').uploadify({
'swf' : '/js/lib/uploadify/uploadify.swf',
'uploader' : '/service/uploadapplicationform',
'multi' : false,
'auto' : true,
'fileTypeExts' : '*.pdf',
'fileSizeLimit' : '20MB',
'onUploadSuccess' : function(file, data, response) {
upload.onsuccess(file, data, response);
},
'onUploadStart' : function(file) {
$('#file_upload').uploadify('settings','formData',param);
}
});
});
var upload = {
onsuccess : function(file, data, response){
_data = $.parseJSON(data);
if(!$.isEmptyObject(_data.error))
{
alert(_data.error);
}else{
$('#upload-form').modal('hide');
window.location = window.location;
}
},
showUploadForm : function(id){
$('#upload-form').modal('show');
param = {
"PHPSESSID" : _this.SessionID,
'offlineappid' : id
};
}
};