Somewhat of a 2 part question:
How would I implement some javascript in here that calls the #refresh
to allow a count up timer in text form, let's say starting at 0 seconds that runs up to 3 minutes which then refreshes and starts back at zero - which refreshes a specific div that the id is in?
$(document).ready(function () {
var interval = 180000; // set for 3 minutes
var refresh = function() {
$.ajax({
url: "servers.php",
cache: false,
success: function(html) {
$('#refresh').html(html);
setTimeout(function() {
refresh();
}, interval);
}
});
};
refresh();
});
<div id="refresh"><p>Last Scanned: ???</p></div>
Also, I'm still fairly new to AJAX, so if the above code is out of whack or incorrect, please let me know and also where I went wrong...