Hi Soujanya,
var city=owner_location[0].fields_.locality references fields which
are not a standard part of the API. There should not be any
documentation that instructs you to use these fields.
To get information out of an address object, use the following sample:
function response(data) {
output(data);
var owner = data.get("req").getData();
var addresses = owner.getField(opensocial.Person.Field.ADDRESSES) ||
[];
if (addresses.length > 0) {
var address1locality =
address[0].getField(opensocial.Address.Field.LOCALITY);
alert(address1locality);
}
};
function request() {
var req = opensocial.newDataRequest();
var params = {};
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
[
opensocial.Person.Field.ADDRESSES
];
req.add(req.newFetchPersonRequest(
opensocial.IdSpec.PersonId.OWNER, params), "req");
req.send(response);
};
request();
It looks like you might be working on orkut, which doesn't seem to be
returning an array of ADDRESS objects (it seems to be returning
CURRENT_LOCATION instead). You should report this as an orkut bug
here: http://code.google.com/p/opensocial-resources/issues/list
Thanks,
~Arne
On Sep 20, 12:51 am, soujanya <[EMAIL PROTECTED]> wrote:
> The API is throwing the CurrentLocation Details.But fromt he past
> 10-15
> days the location details are not available when read in the format
> given
> in the API documentation.
>
> What steps will reproduce the problem?
> ======================================
> 1. append address parameter to the API call
> 2. Read the Address details this way
> var
> owner_location=data.get("owner").getData().getField(opensocial.Person.Field.ADDRESSES)
> 3. var city=owner_location[0].fields_.locality
>
> What is the expected output?
> ============================
> The city of the owner as given in the profile
>
> What is the actual output?
> ==========================
> It is throwing "undefined".
>
> Which browsers have you experienced this on?
> ============================================
> IE,Firefox
>
> Additional information
> ======================
> It worked normally for the past few weeks.But from the last 15-20
> days is
> it throwing "undefined",while the api has the currentlocation
> details ,when
> checked in the firebug.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---