Frame with embedded scripts problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    Frame with embedded scripts 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 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_Change BoxSize(newSize ){

    var newBox = new Array(newSize);

    var newPageName = getBoxASPPageNa me(newSize);


    initializeCandy Box(newSize,new Box);


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

    newBox[x] = this.BoxContent s[x];

    }

    this.boxImage = newPageName;

    this.BoxContent s = newBox;


    ** this is the problem section**


    *the source of the frame is changed *

    document.frames[CandyBoxFrameNa me].location.href= this.boxImage;


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

    document.frames[CandyBoxFrameNa me].candyArray=thi s.BoxContents;

    * and finaly call a function from the newly loaded content

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



    Thank you



  • John Taylor-Johnston

    #2
    Re: Frame with embedded scripts problem

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

    Try this code:



    John


    Paul wrote:
    [color=blue]
    > 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_Change BoxSize(newSize ){
    >
    > var newBox = new Array(newSize);
    >
    > var newPageName = getBoxASPPageNa me(newSize);
    >
    > initializeCandy Box(newSize,new Box);
    >
    > for(var x=0;x<this.size ;x++){
    >
    > newBox[x] = this.BoxContent s[x];
    >
    > }
    >
    > this.boxImage = newPageName;
    >
    > this.BoxContent s = newBox;
    >
    > ** this is the problem section**
    >
    > *the source of the frame is changed *
    >
    > document.frames[CandyBoxFrameNa me].location.href= this.boxImage;
    >
    > * then I wish to pass to the new page a variable
    >
    > document.frames[CandyBoxFrameNa me].candyArray=thi s.BoxContents;
    >
    > * and finaly call a function from the newly loaded content
    >
    > document.frames['boxIFrame'].showCandies();
    >
    > Thank you[/color]

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

    819-569-2064


    Comment

    Working...