Bug Tracker

Modify

Ticket #6650 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

$.ajax data conversion not according to the documentation.

Reported by: jq_johan Owned by:
Priority: Milestone: 1.4.3
Component: data Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

In the doc  http://api.jquery.com/jQuery.ajax/ (data section)it says: "{foo:["bar1", "bar2"]} becomes '&foo=bar1&foo=bar2'"

But actually {foo:["bar1", "bar2"]} becomes: '&foo[]=bar1&foo[]=bar2'

My code:

$(document).ready(function(){

$("a.myLink").bind("click",function(){

$.ajax({

url:"ajaxPage.html", data: {foo:["bar1","bar2"]}

});

}) ;

});

Change History

comment:1 Changed 3 years ago by dmethvin

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

That was a change between 1.3.2 and 1.4. If you pass traditional:true you can get back the old behavior. I have updated the documentation to clarify things.

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.