I think you are getting the error, because you didnt define a return-data
key for your update, see:
function saveData(key, value)
{
var req = opensocial.newDataRequest();
req.add(req.newUpdatePersonAppDataRequest("VIEWER", key, value),"setdata");
req.send(callbackData);
}
function callbackData(data)
{
if (data.get("setdata").hadError())
{
alert("couldnt save data");
}
}
Try in this way and let me know how it goes.
Regards
Robson Dantas
2010/8/3 <[email protected]>
> Always output "error: undefined". What is I do wrong?
>
> function saveViewerPersistence(key,value){
> var req = opensocial.newDataRequest();
> req.add(req.newUpdatePersonAppDataRequest("VIEWER", key, value));
> req.send(checkSend);
> }
>
> function checkSend(data){
> if (data.hadError()){
> output("error: "+data.getErrorMessage());
> } else {
> output("data saved")
> }
> }
>
> cls();
> saveViewerPersistence("key",456);
>
> --
> 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]<opensocial-orkut%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/opensocial-orkut?hl=en.
>
--
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.