I want to create a project which have a function that will refresh the browser automatically every 5 seconds . But I don't know what to do? I know that I have to put code in a Setinterval block like this:
setinterval(()=>{
// auto refresh code in here
}
As you say settimeout will only work once u need to define it simpe script (only)so everytime page load it works or better to increase intervel time some time due to network issue your page does not load properly your javascript doeasnot load also
<script type="text/javascript">
setTimeout(function(){
window.location.reload(1);
}, 5000);
</script>