Please Help! - window.close() within frame

M

Martin

Hi, this is probably a very basic question but I'm not a javascript
expert!
Sure you get this asked often! Did some research but can't get it
working.
I'm thankful for any help!

Thanks!

Martin

On my index page I have a frame like this:

</HEAD>
....
<FRAME name="main" SRC="login.aspx" APPLICATION="no">
....
<body>
....
<p>This page uses frames, but your browser doesn't support them.</p>
</body>

On the content page (login.aspx) I've a HTML button with a onclick
event for a javascript like this:

<script language="javascript">
<!--
// Function Close - Close Browser Window
function fnclose() {
parent.opener.close();
}
//-->
</script>

Question is, how do I close the window that actually contains the
frame, I mean close the whole browser from login.aspx? How do I
reference the parent window?
 
M

Mick White

Martin said:
Hi, this is probably a very basic question but I'm not a javascript
expert!
Sure you get this asked often! Did some research but can't get it
working.
I'm thankful for any help!

Thanks!

Martin

On my index page I have a frame like this:

</HEAD>
...
<FRAME name="main" SRC="login.aspx" APPLICATION="no">
...
<body>
...
<p>This page uses frames, but your browser doesn't support them.</p>
</body>

On the content page (login.aspx) I've a HTML button with a onclick
event for a javascript like this:

<script language="javascript">
<!--
// Function Close - Close Browser Window
function fnclose() {
parent.opener.close();
}
//-->
</script>

top.close();

Iffy proposition though, unless you spawned the window.
Mick
 
M

Martin Feuersteiner

Mick,

Thanks for your help! Unfortunately, it top.close() doesn't do the trick.
Any other ideas?
 
M

Mick White

Martin said:
Mick,

Thanks for your help! Unfortunately, it top.close() doesn't do the trick.
Any other ideas?


Something's wrong with your coding then.(URL?)

Note that you cannot reliably close a window that you did not create.
Mick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

window.close 3
Please Help? 0
Help please 8
Need help again please 19
window.close() 9
Help with code 0
Calling of parent value along with another page form id 1
Help with my responsive home page 2

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top