SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2004
    Location
    Freeland, WA
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    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

    www.mywebsite.com/userpage01.htm

    load a frameset into that same window at the location

    www.mywebsite.com/index.htm

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

    www.mywebsite.com/user01/index.htm

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

    sub window_onload()
    dim oWinWWFrame
    set oWinWWFrame = window.open("index.htm")
    oWinWWFrame.document.frames("main").location.href = "user01/index.htm"
    window.close
    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
    result.

    _____
    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?

    Regards,
    Chris

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    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?

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


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
  •