Results 1 to 11 of 11

Thread: Close a browser window...

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Angry Close a browser window...

    How can I close a browser window without getting a standard browser confirm box? This is ****ting me up the wall...

    This is the code I am using... the 2nd window opens fine, but the one I am in keeps asking for a second opinion. Goddamn it!!!

    window.close();
    window.open("login.asp", "LoginWindow", "menubar=no, directories=no, location=no, resizable=no, toolbar=no");

    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  2. #2
    If you are getting the script warning "A script is trying to close the browser window" or something like that, you can't get around it; it is a feature of the browser.

  3. #3

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    I've been looking into it elsewhere. Apparently there are ways around it, but they aren't 100%.

    That's a real pain in the arse. Makes doing anything mildly professional looking very bloody difficult...

    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i think that you can still close it...maybe...but you will get that confirm close box.

    I know that if you created the popup, it will not ask you to confirm (at least in IE)

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  5. #5
    scoutt
    Guest
    Originally posted by rjlohan
    That's a real pain in the arse. Makes doing anything mildly professional looking very bloody difficult...

    how professional is it to close the main window if I opened it up?? it is like when I go to your site and you close all my browser windows that would piss me off. close a window that you didn't open, is like having 50 popups on your page. and we know how many people hate popups

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Man's got a point...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    i disabled popups

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  8. #8

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Angry Don't assume too much...

    It is perfectly professional. The windows I am trying to close are ones the site doesn't need, however not with window.open().

    I need to open a second window to remove the menubar, toolbar, etc. from the display, otherwise later on .asp scripts will get buggered up.

    But when I open this second window, there is no need for the index.html which opened it, and I'd rather close it than leave it open. It is basically just a dummy window.

    I can't find a way to remove those things from the display within a page, only through the window.open() method.

    If you have any suggestions, feel free to share, but don't start lecturing me on the ethics of pop-up windows, or closing browser windows. In this instance it is perfectly legitimate. I can find no other way to disable the 'Back' function in the browser, but I also don't want my dummy windows sitting around.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  9. #9
    scoutt
    Guest

    Re: Don't assume too much...

    Originally posted by rjlohan
    It is perfectly professional. The windows I am trying to close are ones the site doesn't need, however not with window.open().

    I need to open a second window to remove the menubar, toolbar, etc. from the display, otherwise later on .asp scripts will get buggered up.

    But when I open this second window, there is no need for the index.html which opened it, and I'd rather close it than leave it open. It is basically just a dummy window.

    I can't find a way to remove those things from the display within a page, only through the window.open() method.

    If you have any suggestions, feel free to share, but don't start lecturing me on the ethics of pop-up windows, or closing browser windows. In this instance it is perfectly legitimate. I can find no other way to disable the 'Back' function in the browser, but I also don't want my dummy windows sitting around.
    dummy window that the surfer opened to get to your site. how is that a dummy window?? if it wasn't for that window you would not get any visitors.
    the toolbar and address bar have nothing to do with your scripts.
    start lecturing you on ethics?? I don't care what you do with your site but if you want visitors to stay at your site I would think of another method of doing what you want. like I said I don't care what you do, but being a webmaster, it is your job to make the surfer happy and stay at your site not piss them off by closing windows that you didn't open. if i wanted to go to another site I would have to open another browser since the one you opened didn't have any toolbars or address bar. that would be enough to piss me off not to go back to your site.

    I beleive that yahoo and cnn are professional sites and they don't do such actions. so explain to me how professional it is to close windows you didn't open.

    just my opinion so don't get pissed at me.

  10. #10
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    it also screws their history.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  11. #11

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Once again, you assume too much.

    Because this isn't a website for surfers to come browsing through.

    It is an online quiz which I am developing for a specific client. To get to this 'site' visitors must be registered. Most of them don't know squat about computers. So I really don't give two hoots about their history or whether they can't see menu bars.

    The 'dummy window' is needed because the user must go through this other app (which is a load of **** anyway, but I can't do anything about that) to get to my quiz.

    I don't want those things there because
    a) I'd like more room for the actual app - the browser menubars/toolbars take up up to 1/4 of the screen.
    b) Like I said, going 'back' screws up the app, and they don't need to anyway.

    Don't assume that you know everything. You don't.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width