How can I get json object from post through ajax

61 views
Skip to first unread message

Kevin Jiang

unread,
Nov 1, 2012, 8:11:09 PM11/1/12
to we...@googlegroups.com
I use jQuery like this:

postData = {'id': 12, 'data': [{'name': 'myname', 'value': 'myvalue'}, {'name': 'myname2', 'value': 'myvalue2'}]};

$.post(url, postData, function(){
});

At backend, I got the post data from web.input() like this:
<Storage {'id': u'12', 'data[0][name]': u'myname', 'data[0][value]': u'myvalue', 'data[1][name]': u'myname2', 'data[1][value]': u'myvalue2'}>

My question is how can i get the data field as a list directly.

thanks.
Reply all
Reply to author
Forward
0 new messages