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?
-
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
1 Answer
Reset to default 7The 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条)