dimanche 25 décembre 2016

How to automatically reload a website

I want my website to reload once when it has already opened. I wrote this function in my javascript file for that...

var i;
$(document).ready(function(){
    for ( i=0;i<1;i++){
        if(i===0){
            location.reload();
            break;
        }  
    }
})

But the site keeps reloading again and again as if the above function was a recursive one.
How do I do this?




Aucun commentaire:

Enregistrer un commentaire