Update:
Please take a look at this.
I don't think it has anything to do with window.load
stuff. It looks like a setInterval
and alert
issue. I want to find a best number with a fixed reason, not just some number by luck.
$('body').text('5');
alert('ok1');
$('body').text('6');
setTimeout(function(){
alert('ok2');
},0)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
How do I make sure the HTML page is rendered before alert
pops up?