查看文章
 
File Upload Plugin for jQuery
2007年08月16日 星期四 20:04
一个jQuery文件上传的插件,但没有带进度条,不能多文件上传,那就自己实现咯

Download Click here.

另外有一个说可是多文件上传的插件,但没有提交的功能只有选择功能。Multiple File Upload plugin for jQuery

执行上传的函数
/*
    url: 处理上传的url,如upload.php
    fileElementId: 文件输入表单元素的ID,也可以是$FILES 数据的索引(这个的用法没有说明,或许可以实现多文件上传)
    dataType: 支持 json, xml
    secureuri:use secure protocol
    success: 成功后返回的函数
    error: 错误后返回的函数
   
*/
$.ajaxFileUpload
(
    {
        url:'doajaxfileupload.php',
        secureuri:false,
        fileElementId:'fileToUpload',
        dataType: 'json',
        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);
        }
    }
)

类别:Jquery||添加到搜藏 |分享到i贴吧|浏览(3493)|评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
     

   
帮助中心 | 空间客服 | 投诉中心 | 空间协议
©2012 Baidu