gpt4 book ai didi

jquery - 为什么回调出现在 jquery ajax 调用上?

转载 作者:行者123 更新时间:2023-12-01 06:06:19 24 4
gpt4 key购买 nike

在测试页面上我有这个

<script type="text/javascript">
var arreglo = [];
function parse_envivo(data) {
if(data.length != 0) {
alert(data.fuente);
$.each(data, function(index, data) {
if (jQuery.inArray(data.id, arreglo) == -1) {
arreglo.push(data.id);
$("#envivo > tbody:last").append("<tr><td>" + data.titulo + "</td><td>" + data.link + "</td><td>" + data.fuente + "</td></tr>");
}
});
}
}
$(document).ready(function() {
var fecha = Math.round((new Date()).getTime() / 1000);
setInterval(function() {
$.ajax({
data: "fecha="+fecha,
type: "GET",
dataType: "json",
url: "data.php",
success: function(data){
parse_envivo(data);
}
});
}, 5000);
});
</script>

html

                <table cellspacing="0" cellpadding="0" id="envivo">
<thead>
<tr>
<th>Usuario</th>
<th>Acción</th>
<th>Título</th>
</tr>
</thead>
<tbody>
</tbody>
</table>

正在工作...但是当我尝试将其移至我的网站时(使用其他 jquery 函数)

<小时/>

嘿!这是一个 jquery 验证问题。升级到1.8后问题解决了:D

谢谢大家!

最佳答案

尝试使用 POST 而不是 GET...

也许它对你有用..

关于jquery - 为什么回调出现在 jquery ajax 调用上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5664153/

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