A
adnanx82
Hi,
I'm having a hard time figuring out why the onload event is not being
called for the frameset window in the following simple example. It is
being called for each of the component frames.
Here's the code:
mainpage.html:
<html>
<head><title>Main page</title></head>
<frameset rows="200,*,*">
<frame src="f1.html">
<frame src="f2.html">
<frame src="f3.html">
</frameset>
</html>
<script src = "common.js"></script>
------------
f1.html:
<html>
<head><title>Frame 1</title></head>
<body bgcolor="#ffcc00">
<center>THIS IS FRAME 1</center>
</body></html>
<script src = "common.js"></script>
------------
f2.html:
<html>
<head><title>Frame 2</title></head>
<body bgcolor="#6666ff">
<h2>This is Frame 2</h2>
</body></html>
<script src = "common.js"></script>
------------
f3.html:
<html>
<head><title>Frame 3</title></head>
<body bgcolor="#00ff66">
<center>..........frame 3</center>
</body></html>
<script src = "common.js"></script>
------------
common.js:
window.onload = on_load;
function on_load()
{
alert("in on load for " + self.document.location);
}
Thanks and appreciate any help,
-Adnan.
I'm having a hard time figuring out why the onload event is not being
called for the frameset window in the following simple example. It is
being called for each of the component frames.
Here's the code:
mainpage.html:
<html>
<head><title>Main page</title></head>
<frameset rows="200,*,*">
<frame src="f1.html">
<frame src="f2.html">
<frame src="f3.html">
</frameset>
</html>
<script src = "common.js"></script>
------------
f1.html:
<html>
<head><title>Frame 1</title></head>
<body bgcolor="#ffcc00">
<center>THIS IS FRAME 1</center>
</body></html>
<script src = "common.js"></script>
------------
f2.html:
<html>
<head><title>Frame 2</title></head>
<body bgcolor="#6666ff">
<h2>This is Frame 2</h2>
</body></html>
<script src = "common.js"></script>
------------
f3.html:
<html>
<head><title>Frame 3</title></head>
<body bgcolor="#00ff66">
<center>..........frame 3</center>
</body></html>
<script src = "common.js"></script>
------------
common.js:
window.onload = on_load;
function on_load()
{
alert("in on load for " + self.document.location);
}
Thanks and appreciate any help,
-Adnan.