If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > closing browsers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-03, 02:45
kohli4life kohli4life is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
Question closing browsers

OK heres the deal, I got 2 browsers which are open at the same time. I need to be able to close 1 of the browsers by clicking a button/image and then redirecting the other browser to another page. Please help me!!! Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 10-13-03, 02:16
buzzter66 buzzter66 is offline
Registered User
 
Join Date: Nov 2002
Location: Houston, Texas
Posts: 85
Javascript is the answer...

The Javascript needed to close a browser window is:

window.close();

The main thing you need to do is name your windows/browsers so you take control of them.

I suggest these links:
http://www.javascript-coder.com/wind...-example1.html
http://www.javascript-coder.com/wind...ow-close.phtml
----------------------------

By the way, this is a relatively easy task, but there are a few factors that could confuse things. Did one browser open the other browser? This could cause a problem with security and the user will most likely be prompted with a dialog box that asks them if they're sure they want to close the window.

Let me illustrate:

The User opens Browser 1.
The User clicks on something and Browser 2 opens (or it could open automatically).
Browser 2 is now the "child" of Browser 1.
If Browser 2 tries to close Browser 1, Windows will ask the User "Are you Sure?"

There is a workaround for this (I've read it somewhere in this forum), but I urge you not to use it. It's sneaky coding and most people don't like have someone close their browser without asking. Imagine the abuse this could be put to. You come to my page, behind the scenes I make it your new homepage, and now every time you go to another search engine, I close that page. I could make sure you never got to Yahoo again!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On