I would like to be able to run a javascript function that I have that auto processes it so basically runs a function every so often and I want to put that in an if statement in PHP so it will check it every so often for what it's set for. So what I mean by that is when I change a setting it will auto-update the page and either add or remove that element from the if statement. Here is the javascript code. If you need anything else let me know.
<script>
function getStatuscall() {
$.ajax({
type: "GET",
url: "<?php echo BASE_URL; ?>/actions/responderActions.php",
data: {
getStatuscall: 'yes',
responder: 'yes'
},
success: function (response) {
$('#getStatuscall').html(response);
setTimeout(getStatuscall, 5000);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log("Error");
}
});
}
</script>