使用facebook.用于“欣赏”的UI和“;feed"JS错误- c没有定义

Using FB.ui for "apprequest" and "feed" - JS error - c is not defined

本文关键字:错误 JS quot 定义 feed 欣赏 facebook UI 使用 用于      更新时间:2023-09-26

我用FB.ui()调用开发了两个应用程序来发送应用程序请求,并要求使用"feed"参数发布状态更新。它工作了好几个月,但在过去的一周里,我遇到了错误:

c是undefined,第18行:FB.provide("Dom"{containsCss:函数…(oldonload);}oldonload ();};})();文件:all.js

这是从文件all.js我导入使用FB对象从url: http://connect.facebook.net/fr_FR/all.js(我也尝试http://connect.facebook.net/en_US/all.js)

这是导致错误的代码部分:

window.addEvent('domready', function() {
    if(jsonRedirection.redirect == false) {
        FB.init({
          appId  : FBappId,
          status : true, // check login status
          cookie : true, // enable cookies to allow the server to access the session
          xfbml  : true  // parse XFBML
        });
    } 
});
function addFriends()
{
    FB.ui({
        method: 'apprequests',
        message: 'Test'
        },
        function(response) {
            if(response != null) {
                alert('ok');
            }
        }
    );
}

我检查我的appId,我有"fb-root"div之前,我调用我的addFriends函数…

"c is undefined" -这是由于mootools冲突造成的。在未压缩的mootools文件中,有一个函数"function"。实现({"。你可以通过隐藏这个来解决这个问题。

如果你得到这份工作,请告诉我。

确切地说。function . execute ({将会有一个"create: function(options){"。只需将"create"重命名为"create"。ie。大写字母C。我希望,这将解决问题。

问题在函数原型…

Function.implement({
extend: function(properties){
    for (var property in properties) this[property] = properties[property];
    return this;
},
create: function(options){ 

和FB SDK功能:

create:function(c,h){var e=window.FB,d=c?c.split('.'):[],a=d.length;for(var b=0;b<a;b++){var g=d[b];var f=e[g];if(!f){f=(h&&b+1==a)?h:{};e[g]=f;}e=f;}return e;}

解决方案:在mootools中,将"create"重命名为"create2",然后将所有"create("替换为"create2("

其可怕的. .但是,工作. .

MooTools 1.4.3版解决了这个问题-你可以从download MooTools 1.4.3下载