I had come up with these solution:
My Solution / Expectation:
Put a setTimeout(). So if the page will still not load, in 5sec, I will reload(auto) the page.
See code:
var time;
window.onload = function(){
time = setTimeout(function(){ document.location.reload(); }, 5000);
};
$(document).ready(function(){
clearTimeout(time);
});
My Problem with this solution, is that the page will still reload even if the page has already loaded.
I want to cancel the setTimeout if the page has already loaded, but the code above does not working as expected.
Someone could help me, I really needing this to my thesis. Please help. Thanks in adv.