Hi all,

I am sorry if this question has been already asked. I have search all
over this forum, but couldn't find any help on this issue.

I want to create an AJAX call to another server. I have tried using
this example that I have found on:
OpenSocial API developer's guide - Fetching remote content:
http://code.google.com/apis/opensocial/docs/0.7/devguide.html#Remote_Content

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="Fetch Content as Text">
    <Require feature="opensocial-0.7"/>
  </ModulePrefs>
  <Content type="html">
  <![CDATA[
    <div id="content_div"></div>
    <script type="text/javascript">

    function makeNormalRequest() {
      var params = {};
      params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
      var url = "http://www.google.com";;
      gadgets.io.makeRequest(url, response, params);
    };

    function response(obj) {
      //obj.text contains the text of the page that was requested
      var str = obj.text;
      var html =  str.substr(0,400);
      document.getElementById('content_div').innerHTML = html;
    };

    makeNormalRequest();
    </script>
  ]]>
  </Content>
</Module>


But when I try to add this appplication (I have saved the file and
hosted on my server), I have the following errors in my firebug
console:
- gadgets.io has no properties
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;


I have also tried another example provided by google at:
http://code.google.com/apis/gadgets/docs/remote-content.html#Fetch_text
but still no luck.

If any of you can help me, or point me to the right direction, I'd be
very grateful.

Best regards,
Guillaume
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" 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-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to