我想通过AUTOCLICK保存按钮使用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);
}
});
});
});
});
答案 0 :(得分:0)
$.post("dump.php", {
form1: $("#form1").serialize()
}).done(function(msg) {
alert("Form Submitted: " + msg);
});