In what context is the onlogin callback called?

<fb:login-button onlogin="my_callback">

It seems that Facebook Login Button's onlogin callback will only work if the callback is a property of the window, i.e.

window.my_callback = function() { MY_APP.my_callback(); }

Is it possible to make this work, for example:

<fb:login-button onlogin="MY_APP.my_callback">

so I can stop cluttering my window with my_callback

有帮助吗?

解决方案

I got it to work by adding ():

<fb:login-button onlogin="MY_APP.my_callback()">

and I don't know why it works :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top