Ticket #1800 (closed bug: worksforme)
.ajax() data param still not serializing array correctly
| Reported by: | M3Mania | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | ajax | Version: | 1.2.1 |
| Keywords: | ajax param serializing array | Cc: | |
| Blocking: | Blocked by: |
Description
See bug Ticket #1538, which was marked as "wontfix".
However, even using the rather awkward syntax described by John when he closed the ticket, it does not work. Only the first parameter is sent.
Using jQuery.post() works fine, but jQuery.ajax passes only the first parameter regardless of how you pass the data in. For example:
var data = [{name: "id", value: cd_id}, {name: "pronunciation_id", value: pronunciation_id }];
Perhaps I'm being stupid (I'm quite good at that), because it seems strange that such a basic function would not be working.
and
var data = 'id=' + cd_id + '&pronunciation_id=' + pronunciation_id;
Only result in id=15 (the value of 'cd_id') being passed as a post variable. Pronunciation_id is not passed at all.
Attachments
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

