Hello,

I am new to opensocial..can you tell me how can i retrieve an image from the
persistent storage ??

i am providing the code snippet which i used to retrieve d image from
storage but unable to do so ..

<script>
function imageRetrieval()
{
var req = opensocial.newDataRequest();
var image = '<img src="http://img115.imageshack.us/img115/2333/loreal8uc.jpg";
/>';
req.add(newUpdatePersonAppDataRequest("VIEWER", "img", image));
var fields = ["img"];
req.add(newFetchPersonRequest("VIEWER"),"viewer");
req.add(newFetchPersonAppDataRequest("VIEWER", fields), "viewer_data");
req.send(handleData);
}

function handleData(data)
{
var viewer = data.get("viewer").getData();
var key = data.get("viewer_data").getData();
var result = key[viewer.getId()];
document.getElementById("tag_div").innerHTML = result["img"];

}

</script>

<div id = "tag_div"></div>



The code above gives the output as the string provided in variable "image"
i.e., it gives the output in div tag as <img src="
http://img115.imageshack.us/img115/2333/loreal8uc.jpg"; />  inspite of
displaying the image.

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

Reply via email to