Javascript 用于加载内容的FBJS Ajax
我尝试了其中一个例子来加载div中的内容,但是除了显示图像之外,它没有显示任何内容。我错在哪里 文件Javascript 用于加载内容的FBJS Ajax,javascript,ajax,facebook,fbml,fbjs,Javascript,Ajax,Facebook,Fbml,Fbjs,我尝试了其中一个例子来加载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><im
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);
}
FBJS/Ajax没有什么问题。这是
quote.php中的一个错误
我尝试过的一件事是,如果在js文件中调用general_refresh函数,图像将继续显示。但是如果我像上面那样把它放在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>