Does Facebook provide a way to load debug JS?

限于喜欢 提交于 2019-12-06 23:01:38

问题


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?


回答1:


You can reference the debug version using the URL

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




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/7364982/does-facebook-provide-a-way-to-load-debug-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!