题
所以我对整个.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()
不隶属于 StackOverflow