Bug Tracker

Opened 7 years ago

Closed 7 years ago

#6616 closed bug (worksforme)

jQuery $.post bug with square brackets.

Reported by: dencheg Owned by:
Priority: undecided Milestone: 1.4
Component: ajax Version: 1.4
Keywords: post [] square brackets Cc:
Blocked by: Blocking:


var data = {id:id, theme:cthemes, type:ctypes, region:cregions, format:cformats};

data+ id? = type; data+ id? = theme; data+ id? = region; data+ id? = format;

data+ id? = kw; data+ id? = pre; data+ id? = desc; data+ id? = adult; data+ id? = title; data+ id? = quality; data+ id? = ftstatus;

$.post( "{% url editoradmin.views.save_resource %}",

data, function(res, textStatus, XMLHttpRequest) {

alert("hello world");


The data I get in my python code before any changes is: {..., u'ftstatus-657031': [u'dnt'], u'theme-657031[]': [u'37'], u'quality-657031': [u'1'], u'type-657031[]': [u'9'], u'id': [u'657031'], ...}>

The problem is - [] in 'theme-657031[]'. This code works fine in 1.3.2 version, but fails in 1.4.1/1.4.2

Change History (1)

comment:1 Changed 7 years ago by addyosmani

Priority: undecided
Resolution: worksforme
Status: newclosed

Including square brackets when using data() works fine for me. Here are a few different examples: http://jsfiddle.net/addyosmani/Yn5DZ/.
Also, your ticket does not appear to contain sufficient information for us to assist in reproducing the error that you submitted. It looks like you have some application/language specific code in there that isn't provided.
What I'm going to do for now as this is working for me is close it. If you still experience the issue feel free to open a new ticket.

Note: See TracTickets for help on using tickets.