Try using gadgets.util.registerOnLoadHandler to make sure your
makeRequest call is made after the gadget loads. Google should provide
some samples.

On Jul 22, 11:29 am, toonevdb <[email protected]> wrote:
> I tried to build a very simple app to see if I could build all
> functionality needed for an other project but stumbled on a very basic
> problem.
>
> On the orkut container my app hangs on document.getElementById() or
> the innerHTML property.
>
> I have no clue why. Anybody any idea? I tried the code on the netlog
> developer sandbox (which is less sophisticated) and there it works.
>
> See below for source. The alert with called: + obj.text is the last
> executed part.
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <Module>
>   <ModulePrefs title="My Test App" description="" author="Anthony
> Vanden Bossche" author_email="[email protected]">
>         <Require feature="opensocial-0.8" />
>         <Preload href="__MYCONTENT_URL__" authz="none" sign_viewer="false"
> sign_owner="false" />
>   </ModulePrefs>
>   <Content type="html">
>         <![CDATA[
>                 <script type="text/javascript">
>
>                         function initContent(obj)
>                         {
>                                 alert("called: " + obj.text);
>                                 
> alert(document.getElementById("friends").innerHTML);
>                                 html = new Array();
>                                 html.push(obj.text);
>                                 document.getElementById("friends").innerHTML 
> = html.join("");
>                                 alert("passed all");
>                         }
>
>                         //var params = {};
>                         //params[gadgets.io.RequestParameters.CONTENT_TYPE] =
> gadgets.io.ContentType.TEXT;
>                         //params[gadgets.io.RequestParameters.AUTHORIZATION] =
> gadgets.io.AuthorizationType.SIGNED;
>                         //gadgets.io.makeRequest('__MYCONTENT_URL__', 
> initContent, params);
>                         gadgets.io.makeRequest("__MYCONTENT_URL__", 
> initContent);
>                 </script>
>         <p> (4)Here should come content loaded below </p>
>                 <div id="friends">container text should change</div>
>         ]]>
>   </Content>
> </Module>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" 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/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to