This is related to jQuery, not the Python framework that you're using.

Note that the `success` function receives more arguments than just the message.

\malthe

On 16 March 2013 17:09, Gert V <[email protected]> wrote:
> We managed to set up a ajax request with our data inside.
> We get the succes message, but we don't know how to get the json out of our
> ajax request.
>
>
> We added these lines in our views.py
>
> def get_items(request):
>     return {request}
>
> @view_config(route_name='
> diagnose', xhr=True, renderer='json')
> def r_ajax(request):
>     items = get_items(request)
>     logger = logging.getLogger("random")
>     logger.warning(json.dumps(items))
>
>
> our ajax post looks like this:
>                   $.ajax({
>                       type: "POST",
>                       url: "/diagnose",
>                       dataType: "json",
>                       data: Data,
>                       success: function (msg) {
>                         alert("succes: " + msg);
>                       },
>                       error: function(){
>                           alert(msg + 'tet');
>                           }
>                    });
>
> how can we get the json out of our ajax request?
>
>
> On Wednesday, March 13, 2013 4:42:30 PM UTC+1, Gert V wrote:
>>
>> We use pyramid and chameleon template.
>>
>> Currently we have a page where users can fill in a table.
>> This table has a variable lenght because rows are added dynamically.
>> We want to get all the content of the table and put it in a list, so we
>> send it to our database.
>>
>> The biggest problem is that we don't know how to send the data to a list
>> and get it to our vieuw.
>> can some1 help me with this problem?
>> thanks in advance.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Au revoir, et tous mes voeux pour un avenir plein de succès et de bonheur ––

Malthe Borch
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to