I need to call a javascript function when a div is fully rendered. But, I am not aware of the right event to use.
Appreciate your help.
You could put a script inline within the document that calls your function or executes. Just put it logically where it should be rendered.
<html>
<body>
<div><h1>Wait for it!</h1></div>
<script type="text/javascript">
document.write("<h2>Js process</h2>");
alert("Stopping document process");
</script>
<div><h3>Done!</h3></div>
</body>
</html>
No events, just create a callback function, after the writing of html is finished, call your callback routine.
function x ( html, callback) {
divElement.innerHTML = html;
callback();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With