473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

onload and/or readystate==4 on IE 5

Whenever the content of a frame ('mainFrame') has loaded I call a
function. The following code works in IE 5.5+ but IE 5 does nothing (I
have a different technique for MZ, FF...):

window.onload = function() {
var doc = document.getElementById("mainFrame");
doc.onreadystatechange = function() {
if (doc.readyState == 'complete') {
// do stuff
}
}
}
</script>
</head>

<frameset rows="60,100%,60" cols="*" border="0" framespacing="0"
frameborder="0">
<frame src="top.htm" name="topFrame"id="topFrame" scrolling="auto" noresize>
<frame src="about:blank" name="mainFrame" id="mainFrame"
scrolling="auto" noresize>
....

I've tried a variety of things
var doc = window.frames['mainFrame'];
var doc = window.frames[1];
....
doc.onload = function() {
....

Short of putting an onload handler in every page that will be loaded
into the frame, is there a way to get the onload event, of a page in a
frame, trigger a call to a function in the parent frameset?
Andrew Poulos
Jul 23 '05 #1
1 2409
VK
IE 6, all curent releases of FF and NN are acting properly on the
onload event in the frameset: it fires only after "onload" received
from each and every frame. So this script covers all current browsers:
....
<script>
function test() {
var windowObject = self.frames['frameName']; // or
window.frames['frameName']; - egale
var docObject = win.document;
// etc...
}
window.onload = test;
</script>
</head>

<frameset>
....
</frameset>

For legacy browsers I remember some big FAQ 2-3 years ago "How to
detect onload/onerror in my frame", but it was all connected to the
inter-domain security. The frame technics is on the market since
Netscape 2.0 and is one of the most bug-free.

Two things to check:
1) In frameset *any* scripting is *ignored* after the closing </head>
tag.
2) "about:blank" is not a real page but a system DLL call. Unlikely but
it can be some extra security block in IE 5.0. Try to use some real
page "blank.html" instead.

If both things are checked and the script above did not start to work,
reinstall the browser of question, it's broken.

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael J Whitmore | last post by:
I am getting tired of losing hair over this. Here is a function that simply inserts one of three images into a document right before printing. It is called for every element that has a specific...
9
by: Eric Wallstedt | last post by:
I have a page that "logs" changes made to input fields using ajax to pass data to a cgi. I use POST and it works fine most of the time (all the time in IE). But it fails when I get the data from...
7
by: Asterbing | last post by:
Hi, Talking about a js script which changes an iframe src through a "ref_to iframe.setAttribute("src", document_path);", I would like to launch a check() fct when this new document is loaded. ...
2
by: coolvirus | last post by:
I'm using the XMLHTTPRequest JavaScript object to fetch updated info from the server. The problem I'm having occurs on Windows 2000/IE 6. There is a very long pause on readyState 3 (close to a...
6
by: pronerd | last post by:
Hi, I am trying to dynamically set an event handler across frames. I have no problems setting properties across frames doing something like parent.ToolMenuFrame.location.href =...
2
by: RobG | last post by:
There has been a bit of work done to get an init() function to run when the DOM is complete but before all the images have been downloaded. The idea is to kickoff init() scripts when all the...
5
by: steve.chambers | last post by:
I'm sure this q must have been asked before but I'm really struggling to find the answer anywhere so have finally given up and will consult the usenet community - hopefully there's someone out...
3
by: willyWEB66 | last post by:
Hi everyone, I'm having problem with the sequence of execution for xml.onload. It works fine if your not passing parameters to onload event but my code needs to pass parameter to its function. I'm...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.