I am using the below to load a form into a div.
<script>
$("#TheForm").load("Form.php");
</script>
How can I amend this script to load the content (refresh it) every 5 seconds?
You can use setInterval
, Like this:
$("#TheForm").load("Form.php"); // For first time
setInterval(() => {
$("#TheForm").load("Form.php");
}, 5000);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.