I've been attempting to retrieve my status from Facebook using the JavaScript API. Below is the code I have been using:
<div id="fb-root"></div>
<div id="data"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
(function(){
FB.init({
appId : 'SOME ID',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
});
getData();
function getData(){
var query = FB.Data.query('SELECT message FROM status WHERE uid=12345 LIMIT 10');
query.wait(function(rows) {
for(i=0;i<rows.length;i++){
document.getElementById('data').innerHTML += 'Your status is ' + rows[i].message + '<br />';
}
});
}
</script>
Retrieving my name works fine, but encountering issues with retrieving status updates. Could anyone provide assistance in troubleshooting this matter? The documentation has not been very helpful. Please note that I have used a fake UID and included my app ID. Help would be greatly appreciated.