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

B

BerlinBrown

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>
 
M

Madhumita

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.
 
B

BerlinBrown

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.
 
M

Madhumita

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?

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.
 
B

BerlinBrown

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";
}
 
B

BerlinBrown

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,742
Latest member
AshliMayer

Latest Threads

Top