Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reading from child frame/window

    Here's the scoop...

    I have a index.html ("parent") page that calls 2 iframes like this:

    <iframe name="textFrame" id="textFrame" src="blank.html" frameborder="0" border="0" width="350" height="220"></iframe>
    <iframe name="queue" id="queue" src="queue.html" frameborder="0" border="0" width="350" height="220"></iframe>

    I am trying to read the content of queue.html (queue) from my index.html page and write it to blank.html (textFrame) like this:

    var qFrame = document.queue;
    var qmess = qFrame.document.rec_mes;
    textFrame.document.write(qmess);

    The content of queue.html is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD><title>MessQueue</title>
    </HEAD>

    <BODY>
    <div id="rec_mes" name="rec_mes">text goes here</div>
    </BODY>
    </HTML>


    Now... the problem is, instead of it returning "text goes here" it returns "undefined". What am I doing wrong preventing it from pulling the value in the "queue" page. PS- Both of these pages are on the same site (well I'm running them locally with IE as I test) and opened from index.html. I have no problem writing, just the reading of the "queue" page. I have a feeling my DOM or queue page may be incorrect?

    Any help would be appreciated...!!!

    Thanks!

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    hm... do you mean you wanna read smth from a page opened into an iframe to another page opened from the same iframe?... I don't know if it is possible using client-side application... as long as you have not a sort of "anchor"...

    If this is your problem, my ideea is to write whichever on the queue.html using a script written on the parent frame(index), than call that script from the index into blank.html using something like parent.the_function_name()

    The ideea is that when calling a fuction written on parent, you have to specify that...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •