Bug Tracker

Modify

Ticket #1800 (closed bug: worksforme)

Opened 6 years ago

Last modified 6 years ago

.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

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

Change History

comment:1 Changed 6 years ago by john

  • Component changed from core to ajax

Changed 6 years ago by davidserduke

test case

comment:2 Changed 6 years ago by davidserduke

  • Status changed from new to closed
  • Resolution set to worksforme

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.