+ -
当前位置:首页 → 问答吧 → 图片上传时ajaxFileUpload报错

图片上传时ajaxFileUpload报错

时间:2011-05-24

来源:互联网

使用了Fckeditor,每次上传图片时firefox报错:

$.ajaxFileUpload is not a function
[在此错误处中断] error: function (data, status, e) 

原函数如下:
JScript code
function ajaxFileUpload(imageobj,cbhidden,callback)
    {
        $("#loading")
        .ajaxStart(function(){
            $(this).show();
        })
        .ajaxComplete(function(){
            $(this).show();
        });

        $.ajaxFileUpload
        (
            {
                url:pt.get("contextPath")+'/fileuploadservlet',
                secureuri:false,
                fileElementId:'fileToUpload',
                dataType: 'json',
                success: function (data, status)
                {
                    if(typeof(data.error) != 'undefined')
                    {
                        if(data.error != '')
                        {
                            alert(data.error);
                        }else
                        {
                            if(imageobj!=null && imageobj!=undefined)
                            imageobj.src = "/uploadfile/"+data.fileurl;
                            if(cbhidden!=null && cbhidden!=undefined) 
                            cbhidden.value = data.fileurl;
                            alert(data.msg);
                            if(callback != undefined)
                            callback(data,status);
                        }
                    }
                },
                error: function (data, status, e)
                {
                    alert(e);
                }
            }
        )
        
        return false;

    }
    

作者: gaofeng486   发布时间: 2011-05-24

我也遇到同样的问题,求解中

作者: atuo912   发布时间: 2011-05-28