Ajax upload plugin throwing jQuery.handleError not found

后端 未结 6 668
耶瑟儿~
耶瑟儿~ 2020-12-30 01:29

Am using the ajax file upload plugin from PHP Letter and am using jQuery 1.6.2.The files upload properly, but am unable to user the JSON data returned from the php script, w

6条回答
  •  误落风尘
    2020-12-30 01:57

    I also use this plugin and there is some incompability with new versions of jQuery. I use jquery-1.9.1.js on my project.

    The plugin is used with jquery-1.2.1.js .

    I have found a solution on a Chinese website : http://chen-h.iteye.com/blog/1769457 I have tested this version and it works. Callbacks are now okay.

    I don't speak Chinese but I imagine the developer has converted this plugin for new version of Jquery.

    jQuery.extend({
    handleError: function( s, xhr, status, e )      {
        // If a local callback was specified, fire it
                if ( s.error ) {
                    s.error.call( s.context || s, xhr, status, e );
                }
    
                // Fire the global callback
                if ( s.global ) {
                    (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
                }
    },
    createUploadIframe: function(id, uri)
    {
    
        var frameId = 'jUploadFrame' + id;
    
        if(window.ActiveXObject) {
            if(jQuery.browser.version=="9.0")
            {
                io = document.createElement('iframe');
                io.id = frameId;
                io.name = frameId;
            }
            else if(jQuery.browser.version=="6.0" || jQuery.browser.version=="7.0" || jQuery.browser.version=="8.0")
            {
    
                var io = document.createElement('