SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast aivarannamaa's Avatar
    Join Date
    Sep 2002
    Location
    Estonia
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can parent window get to know when child's location is changed?

    I have frameset with two frames: header and content.

    I want topmost window (frameset) to "listen" content frame and change the header frame whenever a new url is loaded on content frame. I don't want to put this header-changing logic in content-frame documents, but into frameset document.

    Closest match I found: put onLoad event handler for content-frame <frame> element in the frameset. This worked with IE6 and Mozilla, but not in Netscape 4. Not so big deal, but anyway, do you know a better way to handle this?

    Aivar

  2. #2
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Putting an onLoad event on your content page is your best bet. In Netscape4, there is actually two top level methods called watch() and unwatch(). The methods can detect when an object changes, and execute an event right afterwards. So you can make it watch your "contentframe.location.href" variable and detects when it changes. Go here for the old Netscape Javascript docs and look for the methods:

    http://developer.netscape.com/docs/m...sref/index.htm

  3. #3
    SitePoint Enthusiast aivarannamaa's Avatar
    Join Date
    Sep 2002
    Location
    Estonia
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Those documents in the content frame are created by different (nontechnical) people (it's an intranet), so I can't rely on any javascript being there.

    But I'm going to check those "watches"

    Thank you!
    Last edited by aivarannamaa; Sep 27, 2002 at 21:26.


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
  •