SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Freeland, WA
    0 Post(s)
    0 Thread(s)

    Cool Help with redirecting to frame in frameset

    Hi all...

    I'm trying to figure out how to start with a simple link
    to an HTML page in the form

    load a frameset into that same window at the location

    but also load a user's page into a frame within that frameset,
    at the location

    One method I've tried is to add a vbscript window_onload
    routine that looks something like:

    sub window_onload()
    dim oWinWWFrame
    set oWinWWFrame ="index.htm")
    oWinWWFrame.document.frames("main").location.href = "user01/index.htm"
    end sub

    This works OK, but opens a new window, leaving the redirection window
    open. Sometimes (strangely) the window.close instruction will
    close the redirection window, sometimes IE presents a dialog
    stating that a script is trying to close a window, and is that OK,
    and sometimes the redirection window simply stays open.
    I'd like to have this work every time, if possible.

    Another method I'm trying is to put a window_onload routine
    in the index.htm frameset, get document.referrer, and parse
    the referring userpage01 URL to determine where the link
    is coming from. The MS DHTML docs state that for security
    reasons document.referrer returns "" if the referring document
    is outside the domain of the target. However, I always get
    "" regardless. I've even tried to put the redirection into an
    <a> element and assert a click event on it, with the same

    The ultimate cool thing would be to load the frameset into the
    same window, but pass off a single string to the frameset as
    the referring document goes away.

    Any ideas?


  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    where the World once stood
    0 Post(s)
    0 Thread(s)
    Hi Chris,

    Sorry I've reread your thread twice, and am still confused as to what you're attempting.

    Are you trying to create a link that changes the current page from a normal window into a frameset? Or simply link to an existing frameset? Or make an existing frameset the current window's document?

    And finally, why? If all you want to put in the frame is some user page, why not make it the source of an iframe?

    Where the World Once Stood
    the blades of grass
    cut me still


Posting Permissions

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