I have a title with a flask jinja2 input. I want to update the title along with some div tags. I update the div tags with setInterval and jquery like this:
<script type="text/javascript">
$(document).ready(function() { /// Wait till page is loaded
setInterval(timingLoad, 15000);
function timingLoad() {
$.get().done(doc => {
$("#main").html($(" #main", doc))
$("#count").html($(" #count", doc))
});
}
}); //// End of Wait till page is loaded
</script>
My title looks like this:
<title id="online_count">{% block title %} ({{online_num}}) Online{% endblock %} </title>
How can I in the setInterval function have the title refresh as well?
Adding $("#online_count").html($(" #online_count", doc))
doesn't work.