Mootools登录Facebook [英] Mootools login facebook

查看:144
本文介绍了Mootools登录Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个简单的网页中,我希望用户能够使用javascript和mootools框架中的脸书帐号登录。代码是:

In a simple webpage I want user to be able to login with his facebook acount which is in javascript and mootools framework. The code is:

    var moofb = new MooFB.Base(APP_ID);
    $('login').addEvent('click', function() {
        moofb = new MooFB.Base(371204703259599);
        moofb.login(function(response) {
            if(response.session) {
                console.log('ifNr1');
                if(response.perms) {
                    console.log(response);
                }
            }
            console.log('User cancelled login or did not fully authorize.');

        }.bind(moofb));
    });

    $('perms').addEvent('click', function() {
        moofb.login(function(response) {
            if(response.session) {
                if(response.perms) {
                }
            }
        }.bind(moofb), {perms: 'read_stream,publish_stream'});
    });

但是登录不起作用。我可以知道问题在哪里吗?

But login does not work. May I know where the problem is?

编辑:如重复的问题所述,有一个错误MooFB.Base不是构造函数

As stated in the duplicate question, there is an error MooFB.Base is not a constructor.

推荐答案

如果您没有包含列出的两个依赖项


  • 核心/类

  • Core / Object

这就是为什么你得到错误 MooFB.Base不是构造函数

This is why you get the error MooFB.Base is not a constructor.

这篇关于Mootools登录Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆