Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get facebook post by a user using graph api?
    text
    copied!<p>I have tried following code to get posts from a user using my app. But, I am getting error occurred in second case while trying to post to user's wall and in retrieving posts, i have only data and pagination. </p> <pre><code>FB.api('/platform/posts', { limit: 3 }, function(response) { console.log('Good to see you, ' + response.length); for (var i=0, l=response.length; i&lt;l; i++) { var post = response[i]; console.log('Good to see you, ' + post); /*if (post.message) { alert('Message: ' + post.message); } else if (post.attachment &amp;&amp; post.attachment.name) { alert('Attachment: ' + post.attachment.name); }*/ } }); var body = 'Reading JS SDK documentation'; FB.api('/me/feed', 'post', { message: body }, function(response) { if (!response || response.error) { alert('Error occured'); } else { alert('Post ID: ' + response.id); } }); </code></pre> <p>what's going wrong? </p> <p>In the second block, alert, "Error occurred" is being displayed. And in the first block, following error occurred: </p> <pre><code>__d("sdk.ErrorHandling", ["sdk.feature","ManagedError","sdk.Runtime","sdk.Scribe","UserAgent","wrapFunction"],function(a,b,c,d,e,f){var g=b('sdk.feature'),h=b('ManagedError'),i=b('sdk.Runtime'),j=b('sdk.Scribe'),k=b('UserAgent'),l=b('wrapFunction'),m=g('error_handling',false),n='';function o(u){var v=u._originalError;delete u._originalError;j.log('jssdk_error',{appId:i.getClientID(),error:u.name||u.message,extra:u});throw v;}function p(u){var v={line:u.lineNumber||u.line,message:u.message,name:u.name,script:u.fileName||u.sourceURL||u.script,stack:u.stackTrace||u.stack};v._originalError=u;if(k.chrome()&amp;&amp;/([\w:\.\/]+\.js):(\d+)/.test(u.stack)){v.script=RegExp.$1;v.line=parseInt(RegExp.$2,10);}for(var w in v)(v[w]==null&amp;&amp;delete v[w]);return v;}function q(u,v){return function(){if(!m)return u.apply(this,arguments);try{n=v;return u.apply(this,arguments);}catch(w){if(w instanceof h)throw w;var x=p(w);x.entry=v;var y=ES5(Array.prototype.slice.call(arguments),'map',true,function(z){var aa=Object.prototype.toString.call(z);return (/^\[object (String|Number|Boolean|Object|Date)\]$/).test(aa)?z:z.toString();});x.args=ES5('JSON','stringify',false,y).substring(0,200);o(x);}finally{n='';}};}function r(u){if(!u.__wrapper)u.__wrapper=function(){try{return u.apply(this,arguments);}catch(v){window.setTimeout(function(){throw v;},0);return false;}};return u.__wrapper;}function s(u,v){return function(w,x){var y=v+':'+(n||'[global]')+':'+(w.name||'[anonymous]'+(arguments.callee.caller.name?'('+arguments.callee.caller.name+')':''));return u(l(w,'entry',y),x);};}if(m){setTimeout=s(setTimeout,'setTimeout');setInterval=s(setInterval,'setInterval');l.setWrapper(q,'entry');}var t={guard:q,unguard:r};e.exports=t;}); </code></pre> <p>Thanks </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload