Skip to main content

Bug Tracker

Side navigation

#6616 closed bug (worksforme)

Opened May 31, 2010 09:44AM UTC

Closed October 19, 2010 08:47PM UTC

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:
Description

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

data['type-' + id] = type;

data['theme-' + id] = theme;

data['region-' + id] = region;

data['format-' + id] = format;

data['kw-' + id] = kw;

data['pre-' + id] = pre;

data['desc-' + id] = desc;

data['adult-' + id] = adult;

data['title-' + id] = title;

data['quality-' + id] = quality;

data['ftstatus-' + 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

Attachments (0)
Change History (1)

Changed October 19, 2010 08:47PM UTC by addyosmani comment:1

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.