我有这两个领域:
<input type="text" name="smsText" value="text sms to send to all">
<input type="text" name="recipients[]" value="3471234567">
<input type="text" name="recipients[]" value="3359876543">
<input type="text" name="recipients[]" value="3201472583">
我需要通过 ajax 调用发送到一个 php 页面。
我有我在许多脚本中使用的这个功能
$("#sendSms").click(function(){
var text = $("input[name=smsText]").val();
var recipients = $("input[name=recipients]").val();
var datastr ='text=' + text +'&recipients=' + recipients;
$(over).appendTo('#box');
$.ajax({
type: "POST",
url: "send-result.php",
data: datastr,
cache: false,
success: function(data){
$('#box').html(data);
}
});
return false;
});
请,我需要帮助来修改我的函数以通过 Ajax 将“smsText”和数组接收者 [] 发送到其他 php 页面......
非常感谢你!