my code return next error: "Missing or malformed url parameter
Error 400", i please of help !!!
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Tarefas My Teste" >
<Require feature="opensocial-0.7"/>
</ModulePrefs>
<Content type="html">
<![CDATA[
<script type="text/javascript">
var htmlout = "";
var me = null;
function AddTarefa() {
var req = opensocial.newDataRequest();
var tarefa = document.getElementById('id_tarefa').value;
req.add(req.newUpdatePersonAppDataRequest("OWNER", "Tarefas",
tarefa));
req.send(requestTarefa);
}
function requestTarefa() {
var req = opensocial.newDataRequest();
var fields = [ "Tarefas" ];
req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.OWNER),
"viewer");
req.add(req.newFetchPersonAppDataRequest("OWNER", fields),
"viewer_data");
req.send(handleRequestMyData);
}
function handleRequestTarefa(data) {
var mydata = data.get("viewer_data");
var viewer = data.get("viewer");
me = viewer.getData();
if (mydata.hadError()) {
htmlout += data.getError();
return;
}
// Do something with the returned data - note the getData call
doSomethingWithMyData(mydata.getData());
}
function doSomethingWithTarefa(data) {
//Data is indexed by user id, and represents an object where
keys
//correspond with the app data fields.
var mydata = data[me.getId()];
var div = document.getElementById('content_div');
htmlout += "Tarefa Adicionada: " + mydata["Tarefas"] + "<br />";
div.innerHTML = htmlout;
}
</script>
<h1>Tarefas do Dia</h1>
<br>
<hr>
<form action="#" name="myform" onSubmit="AddTarefa()">
Tarefa:<input id="id_tarefa" type="text" value="" />
<input type="submit" value="add" name="name_s" />
</form>
<hr>
<div id="content_div"></div>
]]>
</Content>
</Module>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---