答案 0 :(得分:1)
这似乎有效。试一试:
$(function() {
var tracktime;
$(window).blur(function() {
tracktime = new Date();
})
.focus(function() {
if(tracktime && new Date() - tracktime > 60000) {
$.ajax({
url:'/your/path/',
success:function() {
alert('ajax returned')
}
})
}
tracktime = null;
});
});