Hi All,

This post is in regard to my this problem
http://groups.google.com/group/opensocial-orkut/browse_thread/thread/ab468f79abe3b32b

I was searching this forum for any sort of help and came across a
thread where we can pass data from our server to orkut. And this can
be done using JSON. After understanding the solution given there-in, I
wrote a couple of snippets for myself but its getting failed!!

Below is the code of the ASP page which will generate a JSON array and
return to the callback function!!!
######## Match.asp #########
<%
response.write """ids"":[""some id 1"", ""some id 2""]"
%>
<BODY>
<div id="match"></div>
</BODY>
######## Match.asp #########

Below is the JS file
###### FUNCTION MAKING THE REMOTE REQUEST #######
function getSection(url, container)
{
        var link;
        var params = {};
        params[gadgets.io.RequestParameters.METHOD] =
gadgets.io.MethodType.POST;
        params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.JSON;
        link = url+"?usr_id="+usr_id.toString();
        var link1 = [link, "&appId=",gadgets.util.getUrlParameters()
["gadgetId"]].join('');
        alert(link1);
        gadgets.io.makeRequest(link1,handleData,params); //This will call the
Match.asp page
};

####### CALLBACK FUNCTION ########
function handleData(resp)
{
        alert('inside handleData');
        var resultCollection = resp.data.ids; //Giving me Err as resp.data is
null
        alert('passing array of size ' + resultCollection.length);
        for(var j=0; j<=resultCollection.length; j++)
        {
                alert(resultCollection[j]);
        }
        alert('calling showMatch');
        showMatch(resultCollection);
}

I dont know whether I've created the JSON array properly or not and
also I'm using it in the right way in JS. I have never used JSON nor i
know much about it. Whatever I've done is with the help of that thread
and googling some article on JSON.

Can anyone help me on this as soon a possible as I've very less time.
Can anyone please guide me in this coz i know if I get through this
then I'm sure I'll be able to complete my API.

Regards,
Javed
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to