Hi everyone, I'm been into coding for around 3 years, but I haven't touched much of JS. I'm trying to build a simple OpenSocial app and I'm already facing some troubles:
Here's the code: [code] <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Hello World!"> <Require feature="opensocial-0.8" /> </ModulePrefs> <Content type="html"> <![CDATA[ <script type="text/javascript"> function loadData() { var req = opensocial.newDataRequest(); req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER), 'owner'); req.send(fetchPersonHandler); } function fetchPersonHandler(data) { var owner_resp = data.get('owner'); var owner = owner.getData(); document.write("HELLO"); } function init() { loadData(); } gadgets.util.registerOnLoadHandler(init); </script> ]]> </Content> </Module> [/code] Nothing was displayed with the code above. I was expecting to see a "HELLO" when I publish the gadget. When I do a document.write in the function 'init', again nothing is displayed, implying to me that the function doesn't even work. Did I do anything wrong? btw, I'm using the Google Gadget Editor atm. Thanks! -- You received this message because you are subscribed to the Google Groups "OpenSocial Application Development" group. To post to this group, send email to opensocial-...@googlegroups.com. To unsubscribe from this group, send email to opensocial-api+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/opensocial-api?hl=en.