Hi Cinthya. I can see several issues here. First, you need to specify
the format of the returned content; after a quick inspection of your
callback function, I gather that you're expecting a DOM object to be
returned. This DOM object will be stored in the response object's
'data' property; the response object is not a DOM object itself but
the DOM object is accessible through it. Finally, the _gel convenience
function is not supported in Shindig-based containers such as Orkut.
Use document.getElementById instead. Let me know if this works for
you:
function makeDOMRequest() {
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.DOM;
gadgets.io.makeRequest(url, handleResponse, params); //replace
"url" by location of web service
}
function handleResponse(response) {
if (response.data.children.length == 0) {
document.getElementById("adiv").innerHTML = "any message";
return;
} else {
var itemList = response.data.getElementsByTagName("div");
...
}
}
Let me know if you continue to have problems after fixing all of the
issues noted above, and I'll take another look.
- Jason
On Feb 8, 4:16 am, "Cinthya Ruys" <[EMAIL PROTECTED]> wrote:
> Hi Jason,
> my code:
>
> gadgets.io.makeRequest(url, function (response) {
> if (response == null || typeof(response) != "object" ||
> response.firstChild == null) {
> _gel("adiv").innerHTML = "any message";
> return;
> }
>
> // Get a list of the <xxx> element nodes in the file
> var itemList = response.getElementsByTagName("xxx");
>
> if(){
> call a function();
> else
> {
> call other function();
> }
>
> });
> };
>
> This will help you?
>
> Cinthya
>
> 2008/2/7, Jason <[EMAIL PROTECTED]>:
>
>
>
>
>
> > Hi. Can you provide any more information regarding how you're using
> > makeRequest()? A snippet of source code that is either failing or
> > producing the error above will go a long way toward helping us debug
> > the problem. Thanks!
>
> > By the by, the following Wiki page has several sample snippets that
> > demonstrate how gadgets.io.makeRequest() can be used to retrieve a
> > variety of different data formats. Please let me know if this helps.
>
> >http://code.google.com/p/opensocial-resources/wiki/GadgetsMakeRequest
>
> > Cheers!
> > - Jason
>
> > On Feb 7, 6:14 am, "Cinthya Ruys" <[EMAIL PROTECTED]> wrote:
> > > This returns the error for me:
>
> > > INTERNAL_SERVER_ERROR java.lang.RuntimeException:
> > > com.google.net.fastnet.FastNetServiceException: Error talking to
> > > FastNetService: RPC_FAILED.
> > > Request: RequestType: 1
> > > Url: "http://myurl.com"
> > > RequestHeader {
> > > Key: "Cache-Control"
> > > Value: "private"}
>
> > > NumRedirects: 5
> > > UserCookie: "gadgets"
> > > Fetcher: 0
> > > Version: 1
>
> > > Cinthya
>
> > > 2008/2/6, Rajasekhar <[EMAIL PROTECTED]>:
>
> > > > Hai
>
> > > > This is not working
>
> > > --
> > > <img src="http://gsig.brightdev.com/2/cinruys.png">
>
> --
> <img src="http://gsig.brightdev.com/2/cinruys.png">
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---