Frage

Ich bin also eher neu für das Ganze .Post () Erfahrung mit Jquery.

Ich habe bisher nur Erfahrung der Eingabewerte erfahren.Was ich tun möchte, ist ein Array zu posten.

Dies ist ein Standard-Array einer Zahlenliste.Das Endziel: Durchführen einer Abfrage mit diesen Werten.

Könnte mir jemand sein, der mir im Grunde sehr erklärt, wie ich jQuery .Post (), dass ich mein Array posten kann?

Vielen Dank,

War es hilfreich?

Lösung

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

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top