Hi to all,
In my web page I should put a link that once clicked on close the current page.
How is it possible in html? If not, is it possible in javascript?
Thanks
Cla
Not with plain 'ol HTML.
It is possible with JavaScript. And I'll even tell you how to do it:
window.close();
However you'll find that most sensible web designers/developers do not
like to use this technique, and that most users do not like to have their
window closed out from under them.
The only valid time I can imagine this being used is something like:
<a href="#" onClick="window.close()">Close This Window</a>
So that a user *action* closes this window. Not something automated.
However, I have always wondered what the heck is wrong with the window
manager's own "close" button -- the "X" in the upper-right corner in MS
Windows windows, or the whatchamajiggie in the upper left of MacOS
windows, (or, in my case -- KDE on Linux -- the "X" or whatchamajiggie in
whichever corner *I* decide to put it -- but that'll lead me to a long
winding diverted tangential conversation about Linux...um, oops, sorry.
Back to the subject at hand)
Although I will take my mother as the quintessential non-technical
computer user. For her, a large, bold, highlighted link "Close This
Window" is absolutely necessary else she won't remember about the "X" in
the upper-right corner. Of course, she also thought the CD ROM drive was a
built in cup holder***.
--
Jeffrey D. Silverman | (e-mail address removed) **
Website |
http://www.newtnotes.com
(** Drop "pants" to reply by email)
*** Not really. I stole that from off the 'net somewhere.