John
John

Reputation: 1351

Does Facebook provide a way to load debug JS?

There are a number of references to using http://static.ak.fbcdn.net/connect/en_US/core.debug.js to facilitate javascript debugging (e.g. using Firebug) and I remember there was a recommendation in the developer docs some time ago about loading a debug version of the JS lib. The developer docs now only refer to the tool that allows you to submit some javascript on the form.

When I try to have my code load http://static.ak.fbcdn.net/connect/en_US/core.debug.js, the function I assigned to window.fbAsyncInit is not called. If I change to http://connect.facebook.net/en_US/all.js, the code runs, but it's exceedingly difficult to debug my custom XFBML tag code. The more frustrating thing is that my custom tag behaves perfectly when I load the connect-js code that's currently on GitHub.

How can I enable debugging (e.g. using Firebug) where the behavior depends on the Facebook Javascript SDK (all.js)? Is it easier using the Chrome Javascript debugger?

Upvotes: 8

Views: 3535

Answers (3)

Paul Alexander
Paul Alexander

Reputation: 32377

You can reference the debug version using the URL

//connect.facebook.net/en_US/all/debug.js

Upvotes: 11

zachallia
zachallia

Reputation: 1495

Logging is actually enabled by default with the current Facebook JS SDK. That's about all the debugging you'll get. They don't have an uncompressed currently either (although they promised to put one on github in December 2011).

You can only turn off logging by passing {logging: false} to FB.init()

Upvotes: -1

DMCS
DMCS

Reputation: 31880

Without becoming a facebook partner, there is no way to get the debug versions of the API.

I find both Firebug as well as the Chrome debugger to work equally well for me.

Upvotes: 0

Related Questions