Question

Donc, je suis plutôt nouveau à l'ensemble de l'expérience .post () avec jQuery.

Je n'ai que l'expérience d'afficher des valeurs d'entrée jusqu'à présent.Ce que je veux faire, c'est poster un tableau.

Un tableau standard d'une liste de nombres.L'objectif final étant: effectuer une requête avec ces valeurs.

Quelqu'un pourrait-il m'expliquer très fondamentalement comment utiliser jQuery .post () je peux poster mon tableau?

Merci beaucoup,

Était-ce utile?

La solution

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

Autres conseils

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()

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top