Jump to content

Javascript for closing frames


Masterpyro
 Share

Recommended Posts

I have been working on this all night and get figure it out...I want to close 1 from with a button from the same one and have it reload the second frame(similar to google images banner). i have tried self.close(),window.frames[name].close() and all that other stuff and nothing works. I finally got it close to working except taht it closed the whole page.

I am also stuck with a Back button(again similar to google images banner) that i want to have go back to the last page a user was on on my site.

What i have is http://www.freewebs.com/tester14/test1.htm.

From what i know i am limited to JS and HTML so im not sure this is possible.

All help appreciated

Masterpyro

Moonlit: Link fixed.

Link to comment
Share on other sites

To remove the top frame in javascript all you need to do is to set window.top.location.href to the url of the lower frame. However, you cannot read the url from the lower frame from the top frame if the frames are on different domains for security reasons. So you will not be able to cleanly remove the top frame if the lower frame is on a different domain and you moved away from the inital page. You could set the height of the top frame to zero but that isn't a very nice solution since the url in the location field would be wrong.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...