469,903 Members | 1,579 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

function execution sequence problem

The problem I am having involves the sequence of events between frames in an

html page.

The Pages:

Page A has an imbedded IFrame which displays Page B.

Page A has a radio button which on the onClick event calls a function which

changes the source of the IFrame and sends a variable to the newly loaded
page. The Problem is the variable is passed to the page that was contained
in the IFrame before the new page is loaded (see code).

So what I intend is change page in frame, pass variable to new page....

What I get is pass variable to page, change page...

** Code snippets in programmatic order

*the source of the frame is changed *

// change source of IFrame

document.frames[CandyBoxFrameName].location.href=this.boxImage;

* then I wish to pass to the new page a variable

// pass variable to new page

document.frames[CandyBoxFrameName].candyArray=this.BoxContents;

* and finally call a function from the newly loaded content

// call function in new page

document.frames['boxIFrame'].showCandies();

Thank you
Jul 20 '05 #1
5 4935
Lee
Paul said:

The problem I am having involves the sequence of events between frames in an

html page.

The Pages:

Page A has an imbedded IFrame which displays Page B.

Page A has a radio button which on the onClick event calls a function which

changes the source of the IFrame and sends a variable to the newly loaded
page. The Problem is the variable is passed to the page that was contained
in the IFrame before the new page is loaded (see code).

So what I intend is change page in frame, pass variable to new page....


There's no reliable way to know how long it will take to load the new
page, so you should either pass the variable to the frame encoded in
the search part of the URL, or have an onload event handler in the
new page look for a global value in your main page.

Jul 20 '05 #2
I don't think the problem is related to a delay in the loading of the page.
Because if I put a while statement in between the load and the following
action the while loop never exits.

In other words..

// load new content

document.frames[CandyBoxFrameName].location.href=this.boxImage;

// goof off while waiting for page to load

while(document.frames[CandyBoxFrameName].readyState !='complete')
{goof off}

// pass variable to new page
document.frames[CandyBoxFrameName].candyArray=this.BoxContents;

So I am wondering if the browser doesn't refresh content untill all the
scripts on the current page have been completed.

Paul
"Lee" <RE**************@cox.net> wrote in message
news:bp********@drn.newsguy.com...
Paul said:

The problem I am having involves the sequence of events between frames in an
html page.

The Pages:

Page A has an imbedded IFrame which displays Page B.

Page A has a radio button which on the onClick event calls a function which
changes the source of the IFrame and sends a variable to the newly loaded
page. The Problem is the variable is passed to the page that was containedin the IFrame before the new page is loaded (see code).

So what I intend is change page in frame, pass variable to new page....


There's no reliable way to know how long it will take to load the new
page, so you should either pass the variable to the frame encoded in
the search part of the URL, or have an onload event handler in the
new page look for a global value in your main page.

Jul 20 '05 #3
Lee
Paul said:

I don't think the problem is related to a delay in the loading of the page.
Because if I put a while statement in between the load and the following
action the while loop never exits.


It is the delay. The fact that nothing else can happen while you've
got the CPU locked up in a loop doesn't tell you anything about what
happens to more reasonable scripts.

Jul 20 '05 #4
Paul wrote:
while(document.frames[CandyBoxFrameName].readyState !='complete')
{goof off}
`readyState' is an IE-proprietary property, use the standardized `onload'
event handler instead. Otherwise you will lock up the UA and possibly the
system when the property is undefined; it will then evaluate to

while (true)
{
// goof off
}
[Top post]


Please http://www.netmeister.org/news/learn2quote.html
PointedEars
Jul 20 '05 #5
You guys where correct.

The solution used for this problem was to have the onload event of the child
page pull the variable from the parent page.

Thank you for your assistance.

Paul
"Paul" <pa********@hotmaill.com> wrote in message
news:GOQsb.1754$iS6.1416@fed1read04...
I don't think the problem is related to a delay in the loading of the page. Because if I put a while statement in between the load and the following
action the while loop never exits.

In other words..

// load new content

document.frames[CandyBoxFrameName].location.href=this.boxImage;

// goof off while waiting for page to load

while(document.frames[CandyBoxFrameName].readyState !='complete')
{goof off}

// pass variable to new page
document.frames[CandyBoxFrameName].candyArray=this.BoxContents;

So I am wondering if the browser doesn't refresh content untill all the
scripts on the current page have been completed.

Paul
"Lee" <RE**************@cox.net> wrote in message
news:bp********@drn.newsguy.com...
Paul said:

The problem I am having involves the sequence of events between frames in
an

html page.

The Pages:

Page A has an imbedded IFrame which displays Page B.

Page A has a radio button which on the onClick event calls a function which
changes the source of the IFrame and sends a variable to the newly
loadedpage. The Problem is the variable is passed to the page that was

containedin the IFrame before the new page is loaded (see code).

So what I intend is change page in frame, pass variable to new page....


There's no reliable way to know how long it will take to load the new
page, so you should either pass the variable to the frame encoded in
the search part of the URL, or have an onload event handler in the
new page look for a global value in your main page.


Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Joerg Schuster | last post: by
8 posts views Thread by mjm | last post: by
15 posts views Thread by Jens.Toerring | last post: by
16 posts views Thread by mdh | last post: by
42 posts views Thread by Sabiyur | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.