MySpace Developer Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

using JSON with newUpdatePersonAppDataRequest

Last post 03-10-2008 7:24 AM by James. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-05-2008 6:36 AM

    • Yoni
    • Not Ranked
    • Joined on 02-19-2008
    • Posts 4

    using JSON with newUpdatePersonAppDataRequest

     I'm trying to write an application that will keep a data-structure on the viewer's application data.

    I need to use json in order to convert the object to strings. If I try to use gadgets.json.stringify(_obj), as is offered in the openSocial guide ( http://code.google.com/apis/opensocial/docs/0.7/devguide.html ) I get an error from firebug - "gadgets.json has no properties". when I tried using the original methods of JSON, meaning - JSON.stringify() and JSON.eval() - I wasn't able to convert the object back to it's original form, probably because openSocial (as it said in the guide)  performs automatic HTML escaping of all returned data. I've tried using gadgets.util.unescapeString(jsondata) to unescape HTML formed by JSON.stringify() . it didn't work.

    Can you please help? for instance -

    Can you please publish a working example of updating my own data (meaning objects) using json,  and retrieving it later?

    Thanks,

    Yoni. 

     

     

    Thanks,  

     

  • 03-06-2008 12:38 PM In reply to

    Re: using JSON with newUpdatePersonAppDataRequest

    Hey, we haven't included the gadgets reference to the container yet, which is why you're getting a JS error.  When we roll out the 0.7 container it'll have gadgets included and .stringify should work.
  • 03-09-2008 6:32 AM In reply to

    • Yoni
    • Not Ranked
    • Joined on 02-19-2008
    • Posts 4

    Re: using JSON with newUpdatePersonAppDataRequest

    Thanks for the reply. 

    Is there a way using JSON inside the system right now without the gadgets ? (and handling the html-escaping somehow?)

    Thanks. 

    Filed under: ,
  • 03-10-2008 7:24 AM In reply to

    • James
    • Top 150 Contributor
    • Joined on 02-15-2008
    • Posts 23

    Re: using JSON with newUpdatePersonAppDataRequest

    Chad:
    Hey, we haven't included the gadgets reference to the container yet, which is why you're getting a JS error.  When we roll out the 0.7 container it'll have gadgets included and .stringify should work.
     

    var jsonObjects = gadgets.JSON.parse(data);?

Page 1 of 1 (4 items)