我想重复计算时间并每分钟更新一次当前时间。我的代码不起作用。Firebug 控制台说最后一行函数getStatus()
没有定义。如何重复调用这个函数?
jQuery(document).ready(function($){
$(function() {
getStatus();
});
function getStatus() {
var post_id = $('#post_id').val();
var nonce = $('#_wpnonce').val();
jQuery.ajax({
url : ajaxurl,
data : {action: "update_edit_lock", post_id : post_id, nonce: nonce },
success: function(response) {
if(response == "false") {
alert("failed")
}
else {
$("#message").html(response)
}
}
});
setTimeout("getStatus()",60000);
}
},(jQuery));