[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to close a main browser window?

Posted on 2002-03-20
6
Medium Priority
?
239 Views
Last Modified: 2012-05-04
I would like to provide the functionality to close a browser session.  I've found the JavaScript function self.close() and attached it to a button.  Problem is when I use this button a pop-up window first appears asking if I want to close.  I don't want this window...I simply want to close.

0
Comment
Question by:mskvarenina
  • 4
6 Comments
 
LVL 30

Accepted Solution

by:
third earned 200 total points
ID: 6884318
you can't prevent that from happening. it's one of the limitation of what scripts can do with the browser. that would only work with child windows but with the main window it will always come out ;-(. so your option is either stick with it or don't use it.
0
 

Author Comment

by:mskvarenina
ID: 6884346
Wow, so there's no other means at all?  I mean without using self.close()...mayne there's another way?
0
 
LVL 30

Expert Comment

by:third
ID: 6884436
sorry to tell you but there is no other way. this question was asked a lot of times but they've done nothing but to stick with it. ;-(

the other way is by clicking the [X] button on the top-right of your browser's window. ;-) (lol)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:bruno
ID: 6884508
just backing up what third has told you....


trying to close a window by javascript will always get you that prompt UNLESS the window was opened with javascript.

no other way to close it though....because the user opened it, the user has to close it.  i'd be pretty mad if some site just magically closed my browser.....!!!


BRUNO
0
 
LVL 30

Expert Comment

by:third
ID: 6884543
thanks for the backup bruno... ;-)

convinced ??
0
 
LVL 30

Expert Comment

by:third
ID: 6884561
;-)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question