|
ExamplePerson
OWNER のプロフィールを取得して、ID、名前、サムネイルを表示します。
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Person - opensocial-jquery">
<Require feature="dynamic-height" />
<Require feature="opensocial-0.8" />
</ModulePrefs>
<Content type="html"><![CDATA[
<script type="text/javascript" src="http://example.com/opensocial-jquery.min.js"></script>
<script type="text/javascript">
jQuery(function($) {
var url = '/people/@owner/@self';
var data = {};
$.getData(url, data, function(data, status) {
var person = data[0];
if (person.thumbnailUrl)
$('.person .thumbnail img')
.attr('src', person.thumbnailUrl)
.show();
$('.person .id')
.text(person.id);
$('.person .displayName')
.text(person.displayName);
$(window).adjustHeight();
});
});
</script>
<style type="text/css">
<!--
dl dt, dl dd {
margin: 0;
}
-->
</style>
<div id="people">
<dl class="person">
<dt class="thumbnail"><img style="display:none;" /></dt>
<dd class="id"></dd>
<dd class="displayName"></dd>
</dl>
</div>
]]></Content>
</Module>
|
► Sign in to add a comment
good