PJ6 wrote:
Top-posting is not liked here.
Hmmm. That looks like a good way to do it, too. I'd just have to access the
body html element and concatenate extra function names to the OnLoad
attribute, right? With a little work I could even code in some precedence,
like a z-index, only for methods.
What do you mean by access the onload attribute? If you mean doing it
on the server and changing the value of the body's onload attribute in
its HTML source, then you're OK. But you can't access the body's onload
attribute using something like:
alert( body.onload );
The value of the body's onload attribute is added to the window object,
you'll find your functions there:
<head><title>onload play</title>
<script type="text/javascript">
function sayHi(){}
</script>
</head>
<body onload="sayHi();">
<input type="button" value="Show body attributes" onclick="
var prop, i=0;
var txt = ['<b>Body attributes:</b>'];
for ( prop in document.body.attributes ) {
txt.push( i++ + ': ' + prop + ' : '
+ document.body.attributes[prop]);
}
if (window.onload){
txt.push('<br><b>window.onload:</b>',window.onload.toString());
}
document.getElementById('msg').innerHTML = txt.join('<br>');
">
<div id="msg"></div>
</body>
[...]
--
Rob