ITeye博客

jquery上传文件

wangronaldo · 2011-05-22 19:55 · jquery · Web前端 · Java · PHP · json · jQuery · Markdown


$.ajaxFileUpload
		(
			{
				url:'/contents/ajaxfileupload/doajaxfileupload.php',
				secureuri:false,
				fileElementId:'fileToUpload',
				dataType: 'json',
				beforeSend:function()
				{
					$("#loading").show();
				},
				complete:function()
				{
					$("#loading").hide();
				},				
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
						}else
						{
							alert(data.msg);
						}
					}
				},
				error: function (data, status, e)
				{
					alert(e);
				}
			}
		)

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。