onClick="window.close()"

T

Todd Cary

Should this close the window, or have I missed something simple?

Todd

<html>
<head>
<title>Test close</title>
</head>
<body>
This is a test on the closing of a window<br><br>
<input name="btnClose" type="button" onClick="window.close()"
value="Close">
</body>
</html>
 
V

VK

Todd said:
Should this close the window, or have I missed something simple?

Todd

<html>
<head>
<title>Test close</title>
</head>
<body>
This is a test on the closing of a window<br><br>
<input name="btnClose" type="button" onClick="window.close()"
value="Close">
</body>
</html>

<http://www.jibbering.com/faq/#FAQ4_14>

It is a sample of a bad English but if you read through I'll find the
answer.
 
R

rich

Should this close the window, or have I missed something simple?

Todd

<html>
<head>
<title>Test close</title>
</head>
<body>
This is a test on the closing of a window<br><br>
<input name="btnClose" type="button" onClick="window.close()"
value="Close">
</body>
</html>

I think you're running into a problem trying to close the parent window. Some
web browsers like IE will prompt you if you want to close it, but was seeing an
error message in Firefox's Tools / Javascript Console using your example. Should
be able to use "window.close()" on popup windows, but javascript can get a
little picky with the main window.

Rich
 

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


Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,075
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top