Hi there,
I was trying to store persistence data by the following codes.
(reference: http://code.google.com/apis/opensocial/articles/persistence.html)
However, instead of showing the user input, it turned out nothing.
Firebug shows that there is a error occurred.

Error: H.replace is not a function
[Break on this error] },unescapeString:function(H){return H.replace(/
&#([0-9]+);/g,B)

This line isn't part of my code so I have really no clue how to fix
this one.
Is this because of Orkut's constraint or there is something wrong with
my code?
Thank you in advance for your help.

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="hello world example">
<Require feature="opensocial-0.7"/>
</ModulePrefs>

<Content type="html"><![CDATA[
<div id='main'>
<div id='test'> </div>
</div>
<script>
function setRequest() {
var data = {
html : "USER Input"
}
var req = opensocial.newDataRequest();
req.add(req.newUpdatePersonAppDataRequest(
opensocial.DataRequest.PersonId.VIEWER,
"test",
gadgets.json.stringify(data)),
"setData");
req.send(getRequest);
}

function getRequest() {
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(
opensocial.DataRequest.PersonId.VIEWER),
"getViewer");
req.add(req.newFetchPersonAppDataRequest(
opensocial.DataRequest.PersonId.VIEWER,
"test"),
"getData");
req.send(getResponse);
}
function getResponse(data) {
var viewer = data.get("getViewer").getData();
var testData = data.get("getData").getData();
var unescapedTestData = gadgets.util.unescapeString(testData);
var testObject = gadgets.json.parse(unescapedTestData);

document.getElementById("test").innerHTML = testObject.html;
}
</script>
<script>
gadgets.util.registerOnLoadHandler(setRequest);
</script>
]]></Content>
</Module>
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to