开发者

fb:comments blows up with bunch of js errors

开发者 https://www.devze.com 2023-04-05 04:27 出处:网络
I am trying to use FB Comments plugin and while plugin seems to load and work, my site blows up with bunch of Facebook js errors:

I am trying to use FB Comments plugin and while plugin seems to load and work, my site blows up with bunch of Facebook js errors:

  • Error: 'parseInt' is undefined
  • Error: 'Object' is undefined
  • Error: 'FB_RequireFeatures' is undefined
  • Error: 'Date' is undefined
  • Error: Unable to get value of the property 'setResourceMap': object is null or undefined
  • Error: Unable to get value of the property 'configureP开发者_运维技巧age': object is null or undefined

My web page schema is as following:

<body>
<script type="text/javascript" "//static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
if (navigator.userAgent.indexOf("Firefox")!=-1)
FB.init("{appKey}","http://commoninterview.com/modules/fb/xd_receiver.htm");
</script>

HTML...

<div id="fb-root"></div>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

<fb:comments href="{pageURL}" num_posts="10" width="760"></fb:comments>

HTML...

<script type="text/javascript">
FB.init("{appKey}","http://commoninterview.com/modules/fb/xd_receiver.htm");
</script>

Live Example: http://commoninterview.com/interview_puzzles/filling-matrix-interview-puzzle-1/

Any help or pointers are appreciated !


It may be a compatibility issue.

See this snippet taken from this page: "If you upgrade to the new JavaScript SDK, please ensure you remove all references to the old JavaScript library, as they are incompatible and will cause your implementation to stop working. You can find references to the old JavaScript library by searching for the string "FeatureLoader.js.php"."

https://developers.facebook.com/docs/reference/oldjavascript/

It looks like you are mixing old deprecated FB JS code

0

精彩评论

暂无评论...
验证码 换一张
取 消