I’m trying to refresh my recent list every 5 seconds. I was looking at ajax and found jquery.
I found a function known as “everyTime”
This is what I have so far, I don’t really know how to get it to work… It’s not working:\
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).everyTime(5s, function(i) {
<?php include "recent.php";?>
}, 0);
</script>
</head>
<body>
<div id="testDiv">
<h2>This is default. Waiting for refresh</h2>
</div>
</body>
everyTime seems to be a jQuery plugin that has a lot of functionality you’re not using here. For what you’re doing, you can just use
setIntervalthus:where the second parameter is the number of milliseconds.
Note on everyTime
If you really want to use everyTime, you’ll need to make your first parameter a string, that is:
Note the quotes around the 5s. You’ll also need to include the appropriate javascript file for the plugin (not just for jQuery) at the top, i.e.