Forum Moderators: open
parent.frameName.attachEvent('onload',myEvent) function myEvent()
{
}
There are probably equivalent ways of attaching events in NN6 and Opera6 (anyone?)
<<<<<<<<<<<<<<
<html><br>
<head><br>
window.parent.frames["newwin"].attachEvent('onload',myEvent)
<p>function myEvent()<br>
{<br>
alert("My Event");<br>
}<br>
</script><br>
</head><br>
<FRAMESET frameborder=0 rows="100%,*"></p>
<p> <FRAME name="newwin" src="a.html"></p>
<p><br>
</FRAMESET><br>
</html>
>>>>>>>>>>>>
So the next question would be, what did you first set out to accomplish? Can you do that another way, besides detecting the page load? If you come at the problem from "outside the box" a bit, maybe something will occur to you.
In my case, I resolved things through communicating with the web team for the page we were framing. They are European partners of my US client, so cooperation was easily worked out once we tried.
Hai tedster,
My requirement is to target middle of the page were our website info is provided by another website.
They have not provided any target name(#linkname).
I have asked them to provide a target linkname so that I can directly give the link as
<a href="page1.html#linkname">
If they refused to do so I have to scroll the page using window.scroll method.
So I decided to open that link in new window(frame page).
After loading that page I will scroll that page by appropriate offset in (px) say(window.scroll(0,330))
For doing that I should ensure that whether the page is loaded or not. After loading that page only I will be able to scroll that page. Before the loading of that appropriate page we can't scroll that page. It gives error when tried it.
I tried the following by trigerring a event which will execute after 5secs.
It worked fine (offline page).
But the download time of that page may vary depending upon the net connection, which is unpredictable since that page is a very lengthy page. So only I wanted to detect the loading of frame.
-Suresh Babu
As you said co-operation with other web team will solve this issue.
Human cooperation - it's a wonderful thing. And if it's their work and they know you're framing it, they should be happy to make sure it gets displayed well, wouldn't you think?
If you change the order of your page you should find that you'll get an "Access Denied" error instead - this is the error you'd expect when you try to script across domains. It's often best to have scripts that reference document elements in the onload event for that document - preventing any curious "not AN OBJECT" errors.
Best o' luck.