0

I have developed two applications with FB.ui() calls to send app requests and ask to post status update with the "feed" parameters. It worked fine for several months, but for the past week I have been encountering error :

c is undefined line 18 : FB.provide('Dom',{containsCss:function...(oldonload);}else oldonload();};})(); File : all.js

It's from the file all.js I import to use FB object from the url : http://connect.facebook.net/fr_FR/all.js (i also tried http://connect.facebook.net/en_US/all.js)

This is the part of the code which causes the error :

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');
            }
        }
    );
}

I check my appId and I have the "fb-root" div before I call my addFriends function ...

bkaid
  • 51,465
  • 22
  • 112
  • 128
Thomas H.
  • 1
  • 1
  • Here's a simple example based on what you provided: http://fbrell.com/saved/58a66f765babcdd3d7b452afe02b4e41 -- works fine for me. Maybe you can provide some more details? – daaku Jul 19 '11 at 04:08

3 Answers3

1

"c is undefined" - This occurs due to mootools conflict. In uncompressed mootools file, there is a function " Function.implement({ ". You can solve the issue by hiding this.

Let me know, If you get this work.

To be exact. With In, Function.implement({ there will be a "create: function(options){" . Just rename 'create' by 'Create'. ie., Make C - capital letter. I Hope, this will solve the issue.

sathish
  • 800
  • 1
  • 8
  • 19
1

Problem is in the Function prototype..

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

create: function(options){ 

And FB SDK function:

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;}

Solution: In mootools, Rename "create" to "create2" then, replace all "create(" by "create2("

Its horrible.. but, works..

neiker
  • 8,887
  • 4
  • 29
  • 32
0

MooTools version 1.4.3 solves this issue - you may download it from Download MooTools 1.4.3

Zorayr
  • 23,770
  • 8
  • 136
  • 129