What about putting the onLoad into the <BODY...> element
of whatever gets loaded:
<BODY onLoad='myHandler()'>...</BODY> or
<BODY onLoad="alert(\"I'm rich. I mean I'm loaded\")"></BODY>
and include a src attribute in your <IFRAME>?
Or, if you insist on not having a separate document, you could do:
<IFRAME src="javascript:document.write(
"
<BODY onLoad='frameInit()'>
Hi Mom
<SCRIPT type='text/javascript'>
function frameInit() {
var sq='\\'';
alert('I'+sq+'m rich. I'+sq+'m loaded.');
}
</SCRIPT>
</BODY>
");
document.close();">
Shouldn't be displayed
</IFRAME>
Csaba Gabor
(leading spaces/CR inserted for clarity and to prevent wrapping)
> For some reason unknown to me, my aspx page in VS2003 does not
> recognize 'onload' as a valid event for IFRAME. "onload" does not
[quoted text clipped - 7 lines]
> avail. Suggestions gratefully received!
> TR