468,554 Members | 1,863 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

Page and Iframe, wait for iframe to load before manipulating the DOM

Do you know if it is possible to wait for the iframe page to load and
then manipulate the iframe DOM.

E.g.
mypage:
<script>
function myinit() {
theiframe.location = "iframe_with_frames.html"
waitforiframe() {
theiframe.frames[0].location ="mynewpage3.html";
}
}
</script>
<body onload="myinit();">
<iframe src="empty_page.html" name="theiframe" />
</body>

iframe_with_frames.html:
<frameset>
<frame src="page1">
<frame src="page2">
</frameset>
Feb 5 '08 #1
5 6983
On Feb 5, 1:27*pm, BerlinBrown <berlin.br...@gmail.comwrote:
Do you know if it is possible to wait for the iframe page to load and
then manipulate the iframe DOM.

E.g.
mypage:
<script>
* function myinit() {
* * theiframe.location = "iframe_with_frames.html"
* * waitforiframe() {
* * * * * *theiframe.frames[0].location ="mynewpage3.html";
* * }
* }
</script>
<body onload="myinit();">
* <iframe src="empty_page.html" name="theiframe" />
</body>

iframe_with_frames.html:
<frameset>
* <frame src="page1">
* *<frame src="page2">
</frameset>
Hi, Thanks for your reply. I may not have control on the iframe
contents. Also where is waitforiframe being called and where would
trigger the start time in your case?

Thanks.
Feb 5 '08 #2
On Feb 5, 5:04 pm, Madhumita <mita.mal...@gmail.comwrote:
On Feb 5, 1:27 pm, BerlinBrown <berlin.br...@gmail.comwrote:
Do you know if it is possible to wait for the iframe page to load and
then manipulate the iframe DOM.
E.g.
mypage:
<script>
function myinit() {
theiframe.location = "iframe_with_frames.html"
waitforiframe() {
theiframe.frames[0].location ="mynewpage3.html";
}
}
</script>
<body onload="myinit();">
<iframe src="empty_page.html" name="theiframe" />
</body>
iframe_with_frames.html:
<frameset>
<frame src="page1">
<frame src="page2">
</frameset>

Hi, Thanks for your reply. I may not have control on the iframe
contents. Also where is waitforiframe being called and where would
trigger the start time in your case?

Thanks.
That is pseudo code. I don't have the implementation.
waitforiframe() { }

Should you even wait for the iframe to load. Ideally I want to avoid
using timers.

Feb 5 '08 #3
On Feb 5, 2:21*pm, BerlinBrown <berlin.br...@gmail.comwrote:
On Feb 5, 5:04 pm, Madhumita <mita.mal...@gmail.comwrote:


On Feb 5, 1:27 pm, BerlinBrown <berlin.br...@gmail.comwrote:
Do you know if it is possible to wait for the iframe page to load and
then manipulate the iframe DOM.
E.g.
mypage:
<script>
* function myinit() {
* * theiframe.location = "iframe_with_frames.html"
* * waitforiframe() {
* * * * * *theiframe.frames[0].location ="mynewpage3.html";
* * }
* }
</script>
<body onload="myinit();">
* <iframe src="empty_page.html" name="theiframe" />
</body>
iframe_with_frames.html:
<frameset>
* <frame src="page1">
* *<frame src="page2">
</frameset>
Hi, Thanks for your reply. I may not have control on the iframe
contents. Also where is waitforiframe being called and where would
trigger the start time in your case?
Thanks.

That is pseudo code. *I don't have the implementation.
waitforiframe() { }

Should you even wait for the iframe to load. *Ideally I want to avoid
using timers.- Hide quoted text -

- Show quoted text -
Timer means just doing a Date() function. Why would you avoid that?
How else would you compute the loading time?
My question was not implementation specific, I didn't see the use of
your waitforiframe question.

Thanks.
Feb 5 '08 #4
On Feb 5, 5:34 pm, Madhumita <mita.mal...@gmail.comwrote:
On Feb 5, 2:21 pm, BerlinBrown <berlin.br...@gmail.comwrote:
On Feb 5, 5:04 pm, Madhumita <mita.mal...@gmail.comwrote:
On Feb 5, 1:27 pm, BerlinBrown <berlin.br...@gmail.comwrote:
Do you know if it is possible to wait for the iframe page to load and
then manipulate the iframe DOM.
E.g.
mypage:
<script>
function myinit() {
theiframe.location = "iframe_with_frames.html"
waitforiframe() {
theiframe.frames[0].location ="mynewpage3.html";
}
}
</script>
<body onload="myinit();">
<iframe src="empty_page.html" name="theiframe" />
</body>
iframe_with_frames.html:
<frameset>
<frame src="page1">
<frame src="page2">
</frameset>
Hi, Thanks for your reply. I may not have control on the iframe
contents. Also where is waitforiframe being called and where would
trigger the start time in your case?
Thanks.
That is pseudo code. I don't have the implementation.
waitforiframe() { }
Should you even wait for the iframe to load. Ideally I want to avoid
using timers.- Hide quoted text -
- Show quoted text -

Timer means just doing a Date() function. Why would you avoid that?
How else would you compute the loading time?
My question was not implementation specific, I didn't see the use of
your waitforiframe question.

Thanks.
How else would you compute the loading time?
I don't need to compute the loading time? I dont think.

If I run the code here, it won't acknowledge:
theiframe.frames[0]

Because this operation probably hasn't completed yet.
theiframe.location = "iframe_with_frames.html"

Is there a way to "wait" for the iframe to load and then set the frame
data.

I was looking at addEvent.'onload' but from reading online, doesn't
apply to sub-dom objects, only the current page.

function myinit() {
theiframe.location = "iframe_with_frames.html"
theiframe.frames[0].location ="mynewpage3.html";
}

Feb 5 '08 #5
On Feb 5, 5:39 pm, BerlinBrown <berlin.br...@gmail.comwrote:
On Feb 5, 5:34 pm, Madhumita <mita.mal...@gmail.comwrote:
On Feb 5, 2:21 pm, BerlinBrown <berlin.br...@gmail.comwrote:
On Feb 5, 5:04 pm, Madhumita <mita.mal...@gmail.comwrote:
On Feb 5, 1:27 pm, BerlinBrown <berlin.br...@gmail.comwrote:
Do you know if it is possible to wait for the iframe page to load and
then manipulate the iframe DOM.
E.g.
mypage:
<script>
function myinit() {
theiframe.location = "iframe_with_frames.html"
waitforiframe() {
theiframe.frames[0].location ="mynewpage3.html";
}
}
</script>
<body onload="myinit();">
<iframe src="empty_page.html" name="theiframe" />
</body>
iframe_with_frames.html:
<frameset>
<frame src="page1">
<frame src="page2">
</frameset>
Hi, Thanks for your reply. I may not have control on the iframe
contents. Also where is waitforiframe being called and where would
trigger the start time in your case?
Thanks.
That is pseudo code. I don't have the implementation.
waitforiframe() { }
Should you even wait for the iframe to load. Ideally I want to avoid
using timers.- Hide quoted text -
- Show quoted text -
Timer means just doing a Date() function. Why would you avoid that?
How else would you compute the loading time?
My question was not implementation specific, I didn't see the use of
your waitforiframe question.
Thanks.
How else would you compute the loading time?

I don't need to compute the loading time? I dont think.

If I run the code here, it won't acknowledge:
theiframe.frames[0]

Because this operation probably hasn't completed yet.
theiframe.location = "iframe_with_frames.html"

Is there a way to "wait" for the iframe to load and then set the frame
data.

I was looking at addEvent.'onload' but from reading online, doesn't
apply to sub-dom objects, only the current page.

function myinit() {
theiframe.location = "iframe_with_frames.html"
theiframe.frames[0].location ="mynewpage3.html";
}

Sorry, I saw your early question; I am not responding your EARLIER
question. I started a new one on a similar subject. Wow, it is a
small world, the questions are very similar and about the same time.
Feb 5 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by adnanx82 | last post: by
18 posts views Thread by Alan Z. Scharf | last post: by
1 post views Thread by Balaji | last post: by
1 post views Thread by Z1P2 | last post: by
1 post views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
7 posts views Thread by kaer | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.