SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: pop up control

  1. #1
    Technically, a bit dim macdan's Avatar
    Join Date
    Feb 2001
    Location
    London
    Posts
    344
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pop up control

    Hello

    I've opened a pop up with javascript.

    How would I go about controlling the parent window from the pop up, ie. changing it's content:

    I tried this in in the pop up

    <a href="new_page.htm" target="parent"> but that just opens up a new window.

    Any ideas greatly appreciated.
    gorillaweb is a small London based digital design agency.

  2. #2
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:

    <a href="javascriptarent.location='newpage.html'">change parent</a>

  3. #3
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know how that character got in there. should read:
    <a href="javascript:window.parent.location='newpage.html'">change parent</a>

    i don't remember if you need window.parent or just parent but this should work.

  4. #4
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    window.opener

    is the command to the parent window.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  5. #5
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry, studioco is right. i think i'm asleep at the controls. this should work:

    <a href="#" onclick="javascript:top.opener.location='site.html'">change parent</a>

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    javascript:window.opener.location.href='blah.html';

    Is actually the correct reference because the object being opened by the parent is the window, not the document (top).
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


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
  •