无法在 Facebook 应用程序中运行 javascript

发布于 2024-09-28 03:17:07 字数 560 浏览 1 评论 0原文

我正在尝试将我曾经功能齐全的应用程序从使用古老的提要模板转换为新的发布商内容。但是,当尝试初始化新 API 时,我收到了 javascript 错误 a28251737459_FB is not Defined。由于无法调试或查明错误位置,我尝试取出应用主页上除

奇怪的是,我为 Mock AJAX 等定义的所有函数都运行得很好。我似乎无法从脚本的全局范围调用任何函数或引用诸如窗口/文档/FB 之类的对象。

该应用程序处于 FBML 画布模式,并在我自己的 Apache 2 虚拟服务器上运行。要复制错误,请单击表单提交按钮。

链接到我的应用程序: http://apps.facebook.com/sendwhatever/

I'm trying to convert my once fully functional app from using the ancient feed templates to the new publisher stuff. However, when trying to init the new API I got the javascript error a28251737459_FB is not defined. Unable to debug or pinpoint the location of the error, I tried taking out everything on the app's main page except for <script> alert('Test'); </script>. It causes almost the same error as above, a28251737459_alert is not defined.

The weird part is that all my defined functions for Mock AJAX etc run just fine. I just seem to be unable to call any functions or refer to objects such as window/document/FB from the global scope of the script.

The app is in FBML canvas mode and running on my own virtual server under Apache 2. To replicate the error, click the form submission button.

Link to my app:
http://apps.facebook.com/sendwhatever/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

九局 2024-10-05 03:17:07

FBML 应用程序没有完整的 JavaScript 支持。他们使用 facebook 自己的 javascript 实现(包装器),称为 FBJS

您不能在 FBML 应用程序内使用 javascript FB API。您可以使用 FBML 标签。如果 FBML 不够,您可以随时在服务器端使用 facebook API(php?),然后相应地渲染页面(或使用 ajax 向服务器端请求数据,FBJS 支持 ajax)。

FBML apps don't have full javascript support. They use facebook's own javascript implementation (wrapper) called FBJS.

You can't use javascript FB API inside FBML apps. What you can use is FBML tags. If FBML is not enough you can always use facebook API on your server side (php?), and then render page accordingly (or use ajax to ask server side for data, ajax is supported in FBJS).

时光瘦了 2024-10-05 03:17:07

Facebook 会将您的 appID 附加到每个函数中,因此alert('Test') 更改了其名称,FBML 画布应用程序中也不允许出现警报框。您应该使用一些 FBML 元素向用户显示警报

Facebook is appending your appID to every function, so alert('Test') changes its name, also alert boxes are not allowed in FBML canvas apps. You should use some FBML elements to show alert to the user

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文