Web Analytics Made Easy -
StatCounter How to close a window when in a frame? - CodingForum

Announcement

Collapse
No announcement yet.

How to close a window when in a frame?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to close a window when in a frame?

    I have a main page that has a link to a sub-page that is divided into several frames.

    In one of these frames I have put an image that looks like the Windows "X" in the above right corner to close an application.

    When I click on this "X" image, I should return back to the main page (without re-running it), but the following code doesn't work. What am I missing?

    <a href="javascript:window.close()"><img border="0" align="right" src="x.jpg" width="21" height="21"></a>


    Thanks!
    Richard

  • #2
    I found myself the answer to close my page containing frames.

    Change :
    "javascript: window.close()"

    to :
    "javascript: parent.close()"

    and it works!

    Comment

    Working...
    X