The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> What do I put in a hyperlink to close a page?, Close a web page
jmk909er
post Apr 29 2015, 05:06 PM
Post #1


Newbie
*

Group: Members
Posts: 12
Joined: 29-July 14
Member No.: 21,321



I have a simple single web page and I want to have a hyperlink at the bottom to close the page as follows:

QUOTE
"No thanks, I understand these offers will never be made to me again..."


I want to hyperlink the sentence to close the page. I have found some solutions on the web but none seem to work.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 29 2015, 05:33 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You can only do that with JavaScript. But JavaScript can only close a window that's opened by JavaScript, i.e. a classic popup window. Is that what you have?

If you want to close the main window, or any window not opened by JavaScript, it can't be done.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 29 2015, 05:35 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Wait, maybe I misunderstood. What do you mean with closing a page? Close the window or just leave the page and go somewhere else?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jmk909er
post Apr 29 2015, 05:35 PM
Post #4


Newbie
*

Group: Members
Posts: 12
Joined: 29-July 14
Member No.: 21,321



No its just simple HTML
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jmk909er
post Apr 29 2015, 05:36 PM
Post #5


Newbie
*

Group: Members
Posts: 12
Joined: 29-July 14
Member No.: 21,321



I would like to close the page

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 29 2015, 06:32 PM
Post #6


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE
"No thanks, I understand these offers will never be made to me again..."

That sounds like the kind of content you'd find in a popup (or today's javascript+CSS equivalents), not in the main browser window. If it's in the main window the user would close his entire browser, which is probably not wanted.

In either case javascript is the only solution, it can't be done with HTML alone.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 29 2015, 06:59 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(jmk909er @ Apr 30 2015, 12:36 AM) *

I would like to close the page



I hear you, but what does that mean to you? Either you leave the page and go to another page in the same brower window or you close the browser window. You can't really close a page.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jmk909er
post Apr 29 2015, 09:04 PM
Post #8


Newbie
*

Group: Members
Posts: 12
Joined: 29-July 14
Member No.: 21,321



I would like to close the page just like you would go to the top right and click on the X

It doesn't look like this can be done
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 30 2015, 10:10 AM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



OK, then you mean close the WINDOW. Alas my first answer is valid then. You can only do this if the window was opened by JavaScript. So if it is a popup window you can do it, if it isn't you can't.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 12:43 AM