Safari (Mac) close()

M

Marcia Gulesian

The following code works in I.E. (PC) but not Safari (Mac)

window.opener=self;
window.close();

What code will close the page when it runs in Safari?
 
N

Neal

The following code works in I.E. (PC) but not Safari (Mac)

window.opener=self;
window.close();

What code will close the page when it runs in Safari?


Why do you want to close my browser? It's mine, not yours.
 
T

Toby Inkster

Marcia said:
The following code works in I.E. (PC) but not Safari (Mac)
window.opener=self;
window.close();

That's because it takes advantage of a security hole in IE which doesn't
exist in various other browsers.
 
M

Marcia Gulesian

This code is in a function that is called when the user (you) clicks on a
link.
 
D

David Dorward

Marcia said:
The following code works in I.E. (PC) but not Safari (Mac)

window.opener=self;
window.close();

or Opera, Mozilla, Firefox, or any browser which is not IE.

Its generally considered to be a security flaw.
What code will close the page when it runs in Safari?

None. You can only close windows if they were opened with JavaScript.
 
N

Neal

This code is in a function that is called when the user (you) clicks on a
link.

Fixed the order of responses.

I have a little X in the top right. What more do I need? Your user already
knows how to do that.
 
S

Sam Hughes

This code is in a function that is called when the user (you) clicks
on a link.

While it's nice to try to be user-friendly by offering and telling them
explicitly how to close the browser window, wouldn't doing this confuse
them? I am sure they already know how to do this, using their ordinary
user-interface features, and you might get them wondering if there is a
*reason* for you offering this alternate method.
 

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


Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top