facebook javascript api
- by ngreenwood6
I am trying to get my status from facebook using the javascript api. I have the following code:
<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>
When i try to get my name it works fine but the status is not working. Can someone please tell me what I am doing wrong because the documentation for this is horrible. And yes I replaced the uid with a fake one and yes i put in my app id because like i said when i try to get my name it works fine. Any help is appreciated.