【发布时间】:2016-08-06 14:00:26
【问题描述】:
我正在尝试通过 ajax 将数组发布到表单提交时的 php 文件。
<form action="echo.php" method="post">
<input name="qwerty[]" type="text">
<input name="qwerty[]" type="text">
<input type="submit"/>
</form>
基本上,我用它来发布到 php 文件:
function getlist(alt) {
$.ajax({
type:'POST',
url: 'markattlist.php',
data:{today:alt},
success: function(data){
$('#helloflist').html(data);
},
error:function (){}
});
}
上面是我正在尝试做的一个例子。我已经搜索过,但无法找到解决方案。如何通过 ajax 发布数组。
【问题讨论】:
-
你的问题是什么?
-
如何以同样的方式通过 ajax 发布数组?