Jump to content

repeat action every 2 seconds


LemonInflux

Recommended Posts

OK, on my page, I have a piece of PHP code:

 

<?php include('file.php'); ?>

 

I want to repeat this action every 2 seconds. I'm presuming this is javascript, and would work much in the same way as refreshing one part of a page. So, how could I do this? I know nothing about javascript, so any help is greatly appreciated :)

 

Tom

Link to comment
https://forums.phpfreaks.com/topic/75078-repeat-action-every-2-seconds/
Share on other sites

To be able to do this you would run an ajax request using the setInterval() method. however if you are unfamiliar with javascript or ajax, it would be a task to explain how to do it on a forum. It might be an idea to use a premade library such as scriptaculous or learn javascript its a pretty cool language when you get into it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.