增加了uploadify的错误调试

This commit is contained in:
Li Jianxuan 2011-11-07 02:46:35 +00:00
parent ea17ac8556
commit 8d40a45d1e
1 changed files with 14 additions and 12 deletions

View File

@ -83,7 +83,7 @@
<ul id="datalist">
</ul>
<input id="file_upload" name="Filedata" type="file" />
<input type="button" class="btn btn-small" onclick="$('#file_upload').uploadifyUpload()" value="上传" />
<input type="button" class="btn btn-small" onclick="$('#file_upload').uploadifyUpload();" value="上传" />
<a href="javascript:void(0);" onclick="$('#showexts').toggle()">查看可上传的附件类型</a>
<div id='showexts' style="display:none;">'doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2','gif', 'jpg', 'jpeg', 'png', 'bmp', 'pdf'</div>
</p>
@ -188,7 +188,7 @@ $(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : '/static/js/uploadify/uploadify.swf',
'scriptData' : {'PHPSESSID' : '<?php echo session_id(); ?>'},
'scriptData': {'PHPSESSID' : '<?php echo session_id(); ?>'},
'script' : '/upload',
'cancelImg' : '/static/js/uploadify/cancel.png',
'folder' : '/uploads',
@ -200,11 +200,7 @@ $(document).ready(function() {
var obj = jQuery.parseJSON(response);
var html;
if(obj.error=='')
{
html = obj.html;
}else{
html = obj.error;
}
{html = obj.html;}else{html = obj.error;}
$('<li/>', {
"id":'uploadedItem_'+obj.attid,
"class":'uploadifyQueueItem',
@ -213,6 +209,9 @@ $(document).ready(function() {
$('#deletebtn_'+obj.attid).bind('click', function() {
deleteatt(obj.attid);
});
},
'onError' : function (event,ID,fileObj,errorObj) {
alert(errorObj.type + ' Error: ' + errorObj.info);
}
});
@ -245,6 +244,9 @@ $(document).ready(function() {
});
}
});
function checkfiles(rid){
alert(rid);
}
});
</script>