Hello mate
I'm trying to parse the JSON object inside the callback method from my
client side, I got a message saying "No JSON object could be
decoded"... Do you please have any idea about what I'm doing wrong in
my callback method...Below you can see the sample of the callback
method, and format of JSON message sent from server... thanks

 # from the client side I receive a JSON msg in callback that i want
to parse:

function Save() {
  var data = $.toJSON( ....# I convert JSON object to simple text
here....));
                        $.ajax({
                                type: 'POST',
                                url: '{{=URL(r=request,f='action')}}',
                                contentType: "application/json;
                                charset=utf-8",
                                data: data,
                                dataType: 'json'
                                success:  function(data){ {{
                                                        import
gluon.contrib.simplejson as sj
                                                        data = sj.loads
(response.body.read())
                                                         value = data
["Name"][0]["key1"]
                                                                   }}
                                                  alert({{=value}}); }
                               });
                });

                }

Here is the format of the JSON that is sent as a response from my
action client (I can see it from Firebug debuger)

{
  "Name":
    [
     {  "Key1": "value1",
        "key2": value2,
        "data": {"key": "value3"}
     },
     {  "Key1": "value1",
        "key2": value2,
        "data": {"key": "value3"}
     },
   ]

}

Any ideas ?

This is the follow-up of this thread:
http://groups.google.com/group/web2py/browse_thread/thread/3a61efd564819cac?hl=en

Thanks,
Yannick P.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to