AJAX functions don't pass JSON with arrays properly
|Reported by:||lukebrookhart||Owned by:||flesler|
|Keywords:||JSON arrays||Cc:||grabanski@…; jeresig@…|
With all the AJAX functions (ie. .load, .post .get, etc) the JSON data that is sent to the server does not pass the array data properly. Due to the way arrays are passed to web servers, the names of the array variables need to be concatenated with "" to signal to the server that there is more than one value.
Web servers will first define the "town" variable with "Apalachin". It will then immediately overwrite "Apalachin" with "Owego", and then overwrite "Owego" with "Binghamton".
If we change the variable name to towns within the AJAX functions, web servers will know that this is an array of values and all will be well. This is same way that web browsers pass an array of values for one variable in forms and query strings.
Change History (3)
comment:1 Changed 8 years ago by flesler
- Component changed from core to ajax
- Owner set to flesler
- Priority changed from major to minor
- Status changed from new to assigned
- Type changed from bug to enhancement