It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                6年前关闭。
            
                    
我正在尝试清空plupload队列,但是它不起作用。我已经检查了几个SO问题并关注了它们,但没有一个对我有用。难道我做错了什么?

// Convert divs to queue widgets when the DOM is ready
$(function () {
    $("#uploader").pluploadQueue({
        // General settings
        runtimes: 'flash,html5,silverlight,browserplus,gears,html4',
        url: '<%= Page.ResolveUrl("~")%>Memories/HandlerAlbumUploader.aspx',
        max_file_size: '10mb',
        chunk_size: '1mb',
        unique_names: true,
        multiple_queues: true,
        // Resize images on clientside if we can
        //resize: { width: 320, height: 240, quality: 90 },

        // Specify what files to browse for
        filters: [
        { title: "Image files", extensions: "jpg,gif,png" }
    ],

        // Flash settings
        flash_swf_url: '<%= Page.ResolveUrl("~")%>Memories/js/plupload.flash.swf',

        // Silverlight settings
        silverlight_xap_url: '<%= Page.ResolveUrl("~")%>Memories/js/plupload.silverlight.xap',

        init: { StateChanged: function (up) {
            // Called when the state of the queue is changed
            if (up.state == plupload.STOPPED) {
                $('#<%=btnSubmit.ClientID%>').removeAttr('disabled');


            }
        }
        }
    });

    var uploader = $('#uploader').plupload('getUploader');
    uploader.splice();
    uploader.refresh();
});

最佳答案

您可能要做的是创建一个按钮或一个链接,单击该链接或链接将调用uploader.splice()

您还需要为QueueChanged事件创建一个回调(使用uploader.bind()),该事件将通过调用splice()触发。使此回调函数清除/重置代表您的队列的UI元素。

阅读文档,所有信息都在这里:http://www.plupload.com/plupload/docs/api/index.html#class_plupload.Uploader.html

关于javascript - 如何清空plupload队列,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13887955/

10-13 06:24