SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict jamesbond's Avatar
    Join Date
    Feb 2001
    Location
    The Netherlands
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    update frame from new window

    Hi,

    I have a frameset consisting of 3 frames.

    In 'frame 1' I have a link that opens a new window.
    In the new window there is a link that should update 'frame 2'.

    I can't get this to work.
    I did find an example on how to update a parent window from a child window:

    -------------
    Within the original window:

    <script language="JavaScript"><!--
    function newWindow(file,window) {
    msgWindow=open(file,window,'resizable=no,width=200,height=200');
    if (msgWindow.opener == null) msgWindow.opener = self;
    }
    //--></script>

    <form>
    <input type="button" value="Open New Window" onClick="newWindow('a.html','window2')">
    </form>


    Within the new window:

    <script language="JavaScript"><!--
    function load(file,target) {
    if (target != '')
    target.window.location.href = file;
    else
    window.location.href = file;
    }
    //--></script>

    <a href="javascript:load('b.html',top.opener)">load document into opener</a>
    <p>
    <a href="javascript:load('b.html','')">load document</a>

    from:
    http://developer.irt.org/script/40.htm
    ---------------


    This works only when I have a link in 'frame 1' which opens a new window and then a link in the new window which updates 'frame 1'

    The problem is how to update 'frame2' from a new window which has been opened by 'frame1'

    I hope I explained it clearly enough

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the framename

    top.framename.location.href=url

    Or you can access it via the frames array

    top.frames[0].location.href=url

    This would access the first frame. You want the second frame so it would be 1.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Addict jamesbond's Avatar
    Join Date
    Feb 2001
    Location
    The Netherlands
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you!


Bookmarks

Posting Permissions

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