0

我想通过自动单击保存按钮使用 AJAX 传递 PLUPUPLOAD 数组,当我按下开始上传按钮时,我从 dump.php 获取输出,如 html5_Plupupload_count=0

<form method="post" name="form1" id="form1" action="dump.php" enctype="multipart/form-data">
        <div id="html5_uploader" style="width: 600px; height: 315px;">Your browser doesn't have HTML 4 support.</div>       
    <input type="submit" value="Save" class="plupload_button" name="subsession" id="subsession"/>
    <input name="eid" type="hidden" id="eid" value="<?php echo time(); ?>" />
</form>
$(function() 
{
    $("#html5_uploader").pluploadQueue(
        {
        runtimes : 'html5',
        url : 'upload.php',        
        unique_names : true,

        filters : [
            {title : "Image files", extensions : "tiff,png,gif,jpg,jpeg,ico,bmp"}
        ]
    });
    $('.plupload_start').click(function(e)
    {   
       $('#subsession').click();
    });
    $(document).ready(function()
    {
        $('.plupload_start').click(function() 
        {
              $.ajax({
                 type: "POST",
                 url: "dump.php",
                 data: {'form1': $("#form1").serialize()},
                 success: function(msg)
                 {
                    alert("Form Submitted: " + msg);
                 }
              });
        });

    });
});
4

1 回答 1

0
     $.post("dump.php", { 
        form1: $("#form1").serialize()
    }).done(function(msg) {  
        alert("Form Submitted: " + msg);
    });
于 2013-08-01T06:33:49.193 回答