admin管理员组文章数量:1356709
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.
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.
Share Improve this question edited Apr 25, 2011 at 6:21 Akram Shahda asked Apr 22, 2011 at 22:59 Akram ShahdaAkram Shahda 14.8k5 gold badges47 silver badges67 bronze badges3 Answers
Reset to default 6You 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();
}
I think that you need something like this:
<!-- This is the Div to be rendered: -->
<div>
<script>
/* This script is executed when all div is rendered!!*/
</script>
</div>
本文标签: javascriptDIV Completely rendered indicator event Stack Overflow
版权声明:本文标题:javascript - DIV: Completely rendered indicator event- Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744004264a2574410.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论