I have a variable called ‘max’ between tags, I execute a function every 5 seconds that checks the new value for the ‘max’ however it doesnt seem to change it?
<script>
var max = <?= max_thread() ?>;
setInterval(get_new, 5000);
function get_new() {
alert(max);
max = 1999999;
alert(max);
}
</script>
Anyone have any ideas?
If you are loading max from the server you will need to use ajax to get a response once the page loads that is the only way to connect back to the server.