Facebook引用应用程序错误 [英] Facebook quote application error

查看:154
本文介绍了Facebook引用应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编写一个Facebook报价应用程序,从PHP / MySQL页面的数据随机生成报价?我已经开发了一个,但是它使用的是FBML不支持的jQuery,因为我想要配置文件选项卡,我宁愿去FBML而不是iframe。

How do I code a Facebook quote application taking its data from PHP/MySQL page generating quotes randomly? I've already developed one, but it's using jQuery which FBML doesn't support and since I'd like the profile tab I'd rather go for FBML instead of iframe.

如何使用jQuery或使用FBJS?

How to do this without jQuery or using FBJS?

<!DOCTYPE html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="css/jquote.css" />

        <!--<script type="text/javascript" src="scripts/jquery-1.4.2.js"></script>-->

        <script type="text/javascript" src="fbjqry/utility.js"></script>
        <script type="text/javascript" src="fbjqry/fjqry.js"></script>
        <script type="text/javascript">
            // On page load, fill the box with content.
            $(document).ready(function() {
                $("#quoteContainer").load("quote.php");
            });

            var auto_refresh = setInterval(
            function ()
            {
                $('#quoteContainer').load('quote.php');
            }, 5000); // refresh every 10000 milliseconds
        </script>

    </head>

    <div id="wrapper">
        <div class="header">&nbsp;Quote of the Day</div>
        <div id="quoteContainer">
        </div>
    </div>
</html>


推荐答案

这是一个很广泛的问题,但基本上你有两个与Facebook的选项。您可以制作一个FBML应用程序,并将您的客户端脚本限制为FBJS,或者您可以创建一个iframe应用程序,并使用您想要的任何Javascript库。

That's a pretty broad question, but basically you have two options with Facebook. You can make an FBML application, and have your client-side scripting limited to FBJS, or you can make an iframe application, and utilize whatever Javascript libraries you want.

中间解决方案是使用< fb:iframe> 标签将iframe放在FBML页面中。 iframe将允许您使用完整的Javascript,但当然,您不能使用其中的代码修改iframe之外的任何内容。它可以是一个很好的工具,但你只需要正确设计你的UI。

The intermediate solution is to put iframes in your FBML pages using the <fb:iframe> tag. The iframes will let you use full Javascript, but of course you can't modify anything outside the iframe using code from inside it. It can be a good tool though, you just have to design your UI properly.

你提到你使用JQuery,但你不是真的说什么。如果您担心AJAX功能, FBJS提供了。如果你想要花哨的效果,那么你可能会失去运气,因为FBJS可以是非常有限的。

You mention that you use JQuery, but you don't really say what for. If you're worried about AJAX functionality, FBJS provides that. If you want fancy effects, then you might be out of luck, as FBJS can be pretty limiting.

另外要记住的是,配置文件选项卡可以获得自己的URL ,所以它们可以指向与主应用程序完全分离的代码。例如,如果您的主要应用程序是从 http://yourapp.com 发送的,则在开发人员设置中,您可以设置个人资料标签位于 http://yourapp.com/profiletab 。没有理由不能将iframe应用程序用作主应用程序,只需为配置文件选项卡编写一些FBML输出。

Another thing to keep in mind is that profile tabs get their own URL, so they can be pointed to completely separate code than the main application. For example, if your main app is served from http://yourapp.com, in the Developer settings you can set the Profile Tab to be at http://yourapp.com/profiletab. There's no reason you couldn't serve out an iframe app as the main application, and just code up some FBML output for the Profile Tab.

这篇关于Facebook引用应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆