I am facing a problem, on my website i am using
<script type="text/javascript">
window.onload = function() {
var countdownElement = document.getElementById('countdown'),
downloadButton = document.getElementById('new_download'),
seconds = 10 ,
second = 0,
interval;
downloadButton.style.display = 'none';
interval = setInterval(function() {
if (second >= seconds) {
downloadButton.style.display = 'block';
countdownElement.style.display = 'none';
clearInterval(interval);
}
second++;
}, 1000);
}
</script>
But some google ads keep on loading and this function don't work. so i thought to stop page load after 10 sec with this script in footer of page
<script type="text/javascript">
setTimeout( function(){
window.stop()
} , 10000 );
</script>
But this is not working, is there any way i can stop page load after some time or skip google ads load time from page load time or other method except window.onload
function