FBJS Ajax加载内容

时间:2010-04-13 16:38:19

标签: javascript ajax facebook fbml fbjs

我尝试了其中一个示例here来加载div中的内容,但除了显示图像外,它没有显示任何内容。我哪里错了?

档案ajax1.js

function General_Refresh(url,div){
    //Showing the load image (pay attention to /> of <img
    document.getElementById(div).setInnerXHTML('<span id="caric"><center><img src="http://website.name/images/ajax-loader.gif" /></center></span>');
    var ajax = new Ajax();
    ajax.responseType = Ajax.FBML;

    ajax.ondone = function(data) {
        //Hide the loading image
        document.getElementById('caric').setStyle('display','none');
        document.getElementById(div).setInnerFBML(data);
    }
    //If there are errors re-try
    ajax.onerror = function() {
        General_Refresh(url,div);
    }
    ajax.post(url);
}

档案quote.html

    <script src="http://website.name/scripts/ajax1.js" type="text/javascript"></script>
    <script type="text/javascript">
        <!--
        General_Refresh("http://website.name/quote.php","quote");
        //-->
    </script>

    <div id="wrapper">
        <div id="quote"><strong>this</strong></div>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

FBJS / Ajax没有任何问题。这是quote.php中的错误。