我试图做一个代码为我的网站Javascript SetInterval帮助。阿贾克斯
function vind(list) {
for (i = 0; i < list.data.length; i++) {
jQuery.ajax({
url: 'https://xyz-abc.com/send.php?post=123',
dataType: 'script',
success: function() {
volve += 1;
if (volve >= list.data.length) {
}
}
});
}
}
所有的代码工作正常。
https://xyz-abc.com/send.php?post=123
https://xyz-abc.com/send.php?post=123
https://xyz-abc.com/send.php?post=123
https://xyz-abc.com/send.php?post=123
代码发布连续。
我想设置每个帖子之间的间隔。
https://xyz-abc.com/send.php?post=123
wait 3 sec.
https://xyz-abc.com/send.php?post=123
wait 3 sec.
https://xyz-abc.com/send.php?post=123
wait 3 sec.
我试过setTimeout不工作。
帮助。
你似乎在你的例子中有一些失踪。 :) – toskv
_set(Interval | Timeout)_对于这种情况并不理想。使用成功回调触发下一篇文章。 – lshettyl
你的代码甚至没有'setTimeout'调用...显示你的尝试 –