开发者

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.fbAsyncIni开发者_StackOverflow中文版t 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?


You can reference the debug version using the URL

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


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.


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()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜