Bug Tracker

Opened 15 years ago

Closed 15 years ago

#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:
Blocked by: Blocking:

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

jquery_test.html (809 bytes) - added by davidserduke 15 years ago.
test case

Download all attachments as: .zip

Change History (3)

comment:1 Changed 15 years ago by john

Component: coreajax

Changed 15 years ago by davidserduke

Attachment: jquery_test.html added

test case

comment:2 Changed 15 years ago by davidserduke

Resolution: worksforme
Status: newclosed

I tried it out in the test case and I got back what I expected. If you have a different test case that fails please reopen the bug and attach it.

Note: See TracTickets for help on using tickets.