ajax的问题

WBOY
WBOYOriginal
2016-06-23 14:23:08882browse


var arr1 = a.split("|");   
for(var i=0;i if(kkk1[i].checked==true){
xmlhttp.open("POST","../php/s18.php",true)
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.onreadystatechange=chuli_18;
xmlhttp.send("aa="+aa);
}
}
checkbox为true的话 就把id传过来 然后删除checkbox对应的数据  如果是几个id 的话我怎么样发送才可以在php接到这些id  我现在3个只能拿到1个


回复讨论(解决方案)

3个id可以直接php/s18.php?id1=1&id2=2&id3=3这样直接传值过去了

也可以json数组传过去

var arr1 = a.split("|");
var s = '';
for(var i=0;i   if(kkk1[i].checked==true){
    s += '&aa[]='+aa;
  }
}
xmlhttp.open("POST","../php/s18.php",true)
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.onreadystatechange=chuli_18;
xmlhttp.send(s.substr(1));

keyword:qwrap

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn