我正在记录每秒刷新页面,并显示console.log
消息:
function refreshEachMinute() {
$.ajax({
type: "POST",
url: "minutesrefresh.php",
//data: dataString,
dataType: "json",
success: function(data) {
//alert('ref');
console.log('ok');
}
});
} // end function refresh
// refresh each minute
setInterval(refreshEachMinute, 1000);
警告消息显示,但console.log
没有。此外,minutesrefresh.php
未在Firebug栏中加载。
答案 0 :(得分:0)
我有时会遇到类似的问题。所以,我没有像这样做,而是将其更改为:
function refreshEachMinute() {
$.ajax({
type: "POST",
url: "minutesrefresh.php",
//data: dataString,
dataType: "json",
success: function(data) {
setTimeout(refreshEachMinute, 1000);
console.log('ok');
}
});
}
$(function(){setTimeout(refreshEachMinute, 1000)});