?
Solved

How to close a main browser window?

Posted on 2002-03-20
6
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

752 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