php - FB.login(null, {scope: 'publish_actions'}); crash - Stack Overflow

Today I came across a very irritating issue. My JavaScript stopped working over night. When a user trie

Today I came across a very irritating issue. My JavaScript stopped working over night. When a user tries to create a FB action on my page there is a funky JS error:

Uncaught TypeError: Cannot read property '__wrapped' of null 

Error occurs in the connect.facebook/en_GB/all.js:82 and it doesn't make sense. In the error chain last line called from my script is FB.login(null, {scope: 'publish_actions'});. There is no AJAX called to Facebook. The JS SDK crashes before it gets anywhere. What is more annoying an old version of my script on different environment works so I can't blame facebook. Do you have any idea where should I look for a problem?

Today I came across a very irritating issue. My JavaScript stopped working over night. When a user tries to create a FB action on my page there is a funky JS error:

Uncaught TypeError: Cannot read property '__wrapped' of null 

Error occurs in the connect.facebook/en_GB/all.js:82 and it doesn't make sense. In the error chain last line called from my script is FB.login(null, {scope: 'publish_actions'});. There is no AJAX called to Facebook. The JS SDK crashes before it gets anywhere. What is more annoying an old version of my script on different environment works so I can't blame facebook. Do you have any idea where should I look for a problem?

Share Improve this question asked Oct 24, 2012 at 11:13 Lukasz KujawaLukasz Kujawa 3,0961 gold badge31 silver badges44 bronze badges 3
  • Check the parameters you are passing to FB.login in your old working sample. – Anirudh Ramanathan Commented Oct 24, 2012 at 11:16
  • I guess you shouldn't be passing null as the first argument. – John Dvorak Commented Oct 24, 2012 at 11:17
  • Parameter are exactly the same FB.login(null, {scope: 'publish_actions'}); – Lukasz Kujawa Commented Oct 24, 2012 at 11:17
Add a ment  | 

1 Answer 1

Reset to default 7

The right syntax of FB.login is

FB.login(function(response) {
   // handle the response
 }, {scope: 'publish_actions'});

Why are you passing null as the parameter? That should contain the function which will process the response received.

At the very least, pass it an empty function, with no body.

(Reference)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744638304a4585279.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信