Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

HTML/Javascript question.

Options
  • 08-07-2005 10:36am
    #1
    Registered Users Posts: 3,012 ✭✭✭


    Is it possible to have frames on a page, but only as part of one?

    Basically, I'm redesigning a website, but I need to keep a search tool funtioning as is. Only problem is that it uses frames to display results.
    I'm under kinda strict guidelines as to how the layout etc has to remain, so the navbar, header are already done in tables.

    Is it possible to have frames in the content space when I already tables on the page?

    If not, I'll open it in a new window, but then all the links on the results open in new windows themselves.
    Is it possible to get the links on the new window to open in the origional one, instead of a new one?


Comments

  • Registered Users Posts: 1,341 ✭✭✭chabsey


    You could use an Iframe in the content area. You can dictate the size of it within the code and it'll integrate the content without being as much hassle as real frames are.


  • Registered Users Posts: 4,475 ✭✭✭corblimey


    You also have the option of window.opener.location.replace("url") to change the main window from the popup...


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    corblimey wrote:
    You also have the option of window.opener.location.replace("url") to change the main window from the popup...
    That sounds like the most suitable solution. How exactly does that work?
    I assume it's an "onclick()" function, but how doe you tell it what window to overwrite?


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    Is there anyway to get that window.locatio.replace(url) function to overwite any page on the same site, or do you have to specify the page to replace?


  • Registered Users Posts: 4,475 ✭✭✭corblimey


    Not sure what you're asking in your second post there, but the window.opener is, I think, an internal JS reference that just returns the name of the window that opened the currently opened window (as in the window that opened the popup). If you want to load a url into different window, just specify the window name (of course this is dependant on you opening the window in the first place, and thus being able to name it).

    onclick is the best way to call it.


  • Advertisement
  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    The window name?
    I thought you had to specify the current url in the window you want to replace.
    How do you get the window name?


  • Registered Users Posts: 4,475 ✭✭✭corblimey


    What I meant was you could use windowname.location.replace("url") to replace a window that has been popped up. But you would need to know the name of the window, so you would really need to have opened it, hence a popup. Exceptionally useless, ain't I?

    Just go back to my original post :D


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    I think I need to make a better explaination.

    I set a link to open a new window, is there a way to make the links in this new window change the content of the original one, and not in the pop-up or a new window?


  • Registered Users Posts: 4,475 ✭✭✭corblimey


    Yep, just use the code in my op. Ignore everything in between :)


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    But how do you get the name of the original browser window?
    I cant specify the url, as I want it to work for any page on the site...


  • Advertisement
  • Registered Users Posts: 4,475 ✭✭✭corblimey


    You want it so that when a link is clicked in the window, the main calling window opens the actual url? window.opener... will work fine. You don't need to specify the window. Whatever opens the popup is the 'opener'


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    BizzyC wrote:
    But how do you get the name of the original browser window?
    I cant specify the url, as I want it to work for any page on the site...

    Let me get this right:

    You have a frameset, and one of the pages in the frameset does a popup with the search page.

    You then want to click a link on on the search page which will change the location of the content page in the frameset?

    Have I got this right?


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    Yes, but no frameset.
    The idea is right, want the links in the pop-up search page to target the window from which it was opened, regardless of the current url.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    well, then the window.opener will work for you.


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    eoin_s wrote:
    well, then the window.opener will work for you.
    But how do I get it to work??


  • Registered Users Posts: 1,268 ✭✭✭hostyle


    BizzyC wrote:
    But how do I get it to work??
    onclick="window.opener.location.href = 'yoururl'; return false"
    

    However, I think opener can get forgotten if you open new page in the child window. Its probably best give the parent a name before opening the child:
    self.name = "myparentwindow";
    

    and then you should be able to use that as your target.


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    ok, so if i understand this correctly, I should add the line
    self.name = "myparentwindow"
    
    and run it before the link is activated to name the window..
    Then in the popup, i set the onclick to
    onclick="window.opener.location.href = 'myparentwindow'; return false"
    
    and bob's me uncle?


  • Registered Users Posts: 3,012 ✭✭✭BizzyC


    Ok got it working. The onclick isn't necessary.
    Once I set the self.name, you can simply use target='name'.

    Thanks for the help guys.


Advertisement