>
> var data = $('.info input[type=\'text\', ....)
> alert(data) // it shows pid=8&topping=1&topping=3&... on and on
> I have a problem on this line
> How can I send the serialized values by using ajax to the python method?
> This is what I wrote
> /////
> ajax('{{=URL('tester',vars=dict(data=data))}}',,box-content');
>
That won't work because dict(data=data) is Python code that is executed on
the server, and "data" is a Javascript variable defined in the client
(after the Python code has already been executed). Anyway, if the values
are in form input elements, the ajax() function will handle the serializing
for you -- you just have to list the names of the input elements as the
second argument:
ajax('{{=URL('tester')}}', ['pid', 'topping'], 'box-content')
Anthony