Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to close a main browser window?

Posted on 2002-03-20
6
Medium Priority
?
236 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
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.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

618 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