如何在使用jquery自动刷新div之前显示消息

use*_*564 5 html css php jquery

我试图在自动刷新div之前显示一条消息.我已经为自动刷新创建了这段代码.

$(document).ready(function()
{
 if setInterval(function() {
   $("#pagere").load(location.href + " #pagere");}, 10000);             
 });
Run Code Online (Sandbox Code Playgroud)

我还需要显示一条消息"page auto refresh in 3 sec...".我怎样才能做到这一点?

Nof*_*ofi 2

尝试这个 :)

$(document).ready(function()
    {
      var alertTimeSec = 3000; //alert time in ms
      var delayTimeSec = 10000; //time delay to refresh in ms
            setTimeout(function () {
               alert("3 Sec more")
            }, (delayTimeSec-alertTimeSec));
            setInterval(function() {
            $("#pagere").load(location.href + " #pagere");}, delayTimeSec);    
    });
Run Code Online (Sandbox Code Playgroud)