Close current web-page

C

cla

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
 
R

rf

cla said:
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?

No.

What is wrong with the browsers close button. It works just like all the
other close buttons in all of the other applications your viewer has.
 
K

Karl Groves

cla said:
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?

Why do you want to close the user's window?
What makes you think that they won't want to go to a different site once
they're done with your site?

-Karl
 
N

Neal

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?

There's only one good reason I can think of to do that and that's if
you're doing, say, a bank website and closing the browser will end the
session. Even then, it's better (and more reliable in the end) to tell the
user to do it manually.

There is no HTML solution, and no reliable Javascript solution which can
work for all users.
 
J

Jeffrey Silverman

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.
 
K

Karl Groves

The only valid time I can imagine this being used is something like:

<a href="#" onClick="window.close()">Close This Window</a>

Oh, a blank fragment identifier? That's cute.

-Karl
 
N

Neal

That's a hash. This is a pound sign: £.

# is, in fact, commonly referred to as the "pound sign" in the US,
regardless of its proper name. Also called the "number sign", the
"tic-tac-toe thingee" and "that funny-looking thing above the 3". I use it
to represent a sharp when typing chord symbols like F#m7(b5).

A rather versatile little guy, that ... what was it called? ;)
 
B

Blinky the Shark

Technically, it cannot be a sharp, as a sharp has the uprights perfectly
vertical and the thicher crossbars at a slant. It can be used to represent
one, but it isn't one really. Other than that, great.

Oh, c'mon. Did I dispute "octothorpe" just because the namesake Thorpe
is a lot taller than he is wide, and the height-width aspects of this
symbol aren't nearly that different? :)
 
N

Neal

Oh, c'mon. Did I dispute "octothorpe" just because the namesake Thorpe
is a lot taller than he is wide, and the height-width aspects of this
symbol aren't nearly that different? :)

Not in writing. But my ESP, well, we'll leave that to guesswork...
 
D

...D.

There's only one good reason I can think of to do that and that's if
you're doing, say, a bank website and closing the browser will end the
session. Even then, it's better (and more reliable in the end) to tell the
user to do it manually.
There is no HTML solution, and no reliable Javascript solution which can
work for all users.

Well I can think of another reason. On an website, there is an application
page that uses HTML. Questions & answer fields.. All links to the website's
pages are target="_blank", that's just the way the webmaster prefers it. So
the user fills out the application, and clicks send. OE opens (for me) and
invites me to send the app. Well, it'd be nice to have the application page
close so the user is back at the website's main page once they exit OE.



...D.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top