开发者

Getting multiple-value parameter passed via a jQuery ajax POST, in JSP

In another question, the following code was offered as a way to send a list of checkboxes via ajax POST:

var data = { 'user_ids[]' : []};
$(":checked").each(function() {
  data['user_ids[]'].push($(this).val());
});
$.post("ajax.php", data);

I have a JSP page in which I would like to parse the value data in data. What format开发者_运维问答 would the data be in (i.e. string or array)? How can I parse it?

Thanks!


  • you don't need []
  • you can obtain the values by request.getParameterValues("user_ids")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜