<div onload="oQuickReply.swap();" ></div>
Can i use for this?
<div onload="oQuickReply.swap();" ></div>
Can i use for this?
The onload event can only be used on the document itself (body), frames, images, and scripts. In other words, it attaches to the body plus each external resource. The div is not an external resource and it's loaded as part of the body, so the onload event doesn't apply there.
I really like the YUI3 library for this sort of thing.
<div id="mydiv"> ... </div>
<script>
YUI().use('node-base', function(Y) {
Y.on("available", someFunction, '#mydiv')
})
No, you can't. The easiest way to make it work would be to put the function call directly after the element
Example:
...
<div id="somid">Some content</div>
<script>oQuickReply.swap('somid');</script>
...
or - even better - just in front of </body>
...
<script>oQuickReply.swap('somid');</script>
</body>