所以我对整个.post()与jquery的体验相当新的。

我迄今为止只经历发布输入值。我想做的就是发布一个数组。

是数字列表的标准数组。最终目标是:用这些值执行查询。

有人可以非常基本上向我解释,如何使用jQuery .post()我可以发布我的数组?

非常感谢,

有帮助吗?

解决方案

I guess, without going into great detail, the answer on you question is called JSON.

The process is easy:

Backend (PHP) Array -> encode as JSON string -> send that JSON string to the browser -> decode the JSON string as Javascript Array

其他提示

Check jQuery.post(). There is an example for posting arrays.

EDITED: Example is like;

$.post("test.php", { 'choices[]': ["Jon", "Susan"] });

Check The jQuery Site and the Docs for jQuery.post()

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top