HighDots Forums  

Frame with embedded scripts problem

Javascript JavaScript language (comp.lang.javascript)


Discuss Frame with embedded scripts problem in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul
 
Posts: n/a

Default Frame with embedded scripts problem - 11-12-2003 , 04:49 PM






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 which contains Page B, and then passes some
variables to Page B.

The Problem:

Page A changes the content of the IFrame, but it appears that the variables
are passed prior to the new content being loaded.

The Question:

How can I send the data to the newly loaded page?



Current Code:

function CandyBox_ChangeBoxSize(newSize){

var newBox = new Array(newSize);

var newPageName = getBoxASPPageName(newSize);


initializeCandyBox(newSize,newBox);


for(var x=0;x<this.size;x++){

newBox[x] = this.BoxContents[x];

}

this.boxImage = newPageName;

this.BoxContents = newBox;


** this is the problem section**


*the source of the frame is changed *

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


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

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

* and finaly call a function from the newly loaded content

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



Thank you




Reply With Quote
  #2  
Old   
John Taylor-Johnston
 
Posts: n/a

Default Re: Frame with embedded scripts problem - 11-12-2003 , 11:33 PM






Have you heard of Hot Potatoes? http://web.uvic.ca/hrd/halfbaked/

Try this code:

http://www.CollegeSherbrooke.qc.ca/l...resent-ex1.htm

John


Paul wrote:

Quote:
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 which contains Page B, and then passes some
variables to Page B.

The Problem:

Page A changes the content of the IFrame, but it appears that the variables
are passed prior to the new content being loaded.

The Question:

How can I send the data to the newly loaded page?

Current Code:

function CandyBox_ChangeBoxSize(newSize){

var newBox = new Array(newSize);

var newPageName = getBoxASPPageName(newSize);

initializeCandyBox(newSize,newBox);

for(var x=0;x<this.size;x++){

newBox[x] = this.BoxContents[x];

}

this.boxImage = newPageName;

this.BoxContents = newBox;

** this is the problem section**

*the source of the frame is changed *

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

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

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

* and finaly call a function from the newly loaded content

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

Thank you
--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not open-source, it's Murphy's Law."

' ' ' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- Université de Sherbrooke:
http://compcanlit.ca/
819-569-2064




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.