gpt4 book ai didi

javascript - FBJS Ajax加载内容

转载 作者:行者123 更新时间:2023-11-28 10:32:39 25 4
gpt4 key购买 nike

我尝试了其中一个示例 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>

最佳答案

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

关于javascript - FBJS Ajax加载内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2631372/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com