Home jquery load content immediately and then update every 10 seconds
Reply: 0

jquery load content immediately and then update every 10 seconds

user584
1#
user584 Published in April 26, 2018, 1:42 pm

I just got this little script working, but there is some problem. I want that content updated every 10 seconds, but when site loaded it takes 10 seconds before content shows up, then updating works.

So how I can get that working so it loads content immediately and then start refreshing every 10 seconds. Thank you.

  hr = new Date().getHours();

  for (var i=0; i < data.length; i++) {
     if (hr >= data[i][0] && hr <= data[i][1]) {
        $("#someContent").html(data[i][2]);

        break;
      }      
    }
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.609386 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO