By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,389 Members | 2,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,389 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.