I have many places in a website where I want javascript code to be executed when the page has loaded, as well as when the area around code is rerendered, e.g.
<div id="blah">
<script>
addLoadEvent(function (){
submenus.init('somedata');
});
</script>
loads of other stuff here
</div>
mostly the code is initialization code for menus, sliders etc etc that exist within the div.
I wanted to handle these code snippets by adding the function calls to the window.onload event.
That works fine for loading the page, BUT if I rerender the area, the window.onload event is not triggered... I have tried this in different browsers, without success.
I cannot use the oncomplete from the elements that cause the rerender, since they are all over the place, and they should not really know about the implementation of the components.
Any ideas how to solve this?