Facebook是否提供加载调试JS的方法

Facebook是否提供加载调试JS的方法

本文介绍了Facebook是否提供加载调试JS的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多关于使用http://static.ak.fbcdn.net/connect/en_US/core.debug.js来促进javascript调试的参考(例如,使用Firebug),并且我记得一段时间以前,开发人员文档中曾建议加载JS库的调试版本.现在,开发人员文档仅引用允许您在表单上提交一些javascript的工具.

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.

当我尝试加载代码http://static.ak.fbcdn.net/connect/en_US/core.debug.js时,未调用分配给window.fbAsyncInit的函数.如果更改为http://connect.facebook.net/en_US/all.js,代码将运行,但是调试自定义XFBML标记代码非常困难.更令人沮丧的是,当我加载当前在GitHub上的connect-js代码时,我的自定义标签的行为完美.

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.

在行为取决于Facebook Javascript SDK(all.js)的情况下,如何启用调试(例如使用Firebug)?使用Chrome Javascript调试器会更容易吗?

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?

推荐答案

您可以使用URL引用调试版本

You can reference the debug version using the URL

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

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

这篇关于Facebook是否提供加载调试JS的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 19:04