Solved

How to close a main browser window?

Posted on 2002-03-20
6
177 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 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Expert Comment

by:bruno
Comment Utility
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
Comment Utility
thanks for the backup bruno... ;-)

convinced ??
0
 
LVL 30

Expert Comment

by:third
Comment Utility
;-)
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now