facebook javascript api

Posted by ngreenwood6 on Stack Overflow See other posts from Stack Overflow or by ngreenwood6
Published on 2010-04-30T22:50:32Z Indexed on 2010/04/30 22:57 UTC
Read the original article Hit count: 317

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about facebook

Related posts about JavaScript