Solved

javascript popup window with no X (close button)

Posted on 2004-10-26
611 Views
Last Modified: 2008-03-03
hello,
i'm developing an intranet system for users here where i work, i'm trying to create an asp driven order entry system. I would like to remote the x (close window) button from the browser, is there a way to do this? I want to do this to force the user to logout instead of x'ing out the window. if it has to be created through a popup window that is fine, any method should work.. thanks!

0
Question by:LTY83
    12 Comments
     
    LVL 4

    Expert Comment

    by:sgalzin
    hi,

    i know how to do that for internet explorer only : would that interest you ? something like this ?

    http://www.doublespiral.net/andalousie/vpa.html

    (click on the picture to see an example of such a window)

    stephane.
    0
     
    LVL 4

    Author Comment

    by:LTY83
    ie should work, however all browers would be better in teh case ie is corrupt and we need to use mozilla or netscape,, but this should be ok
    0
     
    LVL 4

    Author Comment

    by:LTY83
    hmm it appears that window still has an x, however maybe its because i have newest IE browser?
    0
     
    LVL 4

    Author Comment

    by:LTY83
    btw if that is you you are stunning.. :)
    0
     
    LVL 4

    Expert Comment

    by:sgalzin
    thanks ;-)
    my girlfriend & myself in spain !

    i actually put the cross there, you can choose not to have it or put the logout code behind the action, as you wish : it's an image.

    to do that, here's the trick : open a window as fullscreen then resize it :
     var w = window.open ( '', '', 'fullscreen=yes,resizable=yes' );
     w.resizeTo ( 300, 200 );

    hope that helps,

    stephane.
    0
     
    LVL 4

    Expert Comment

    by:sgalzin
    ps : i am sure that won't work in netscape or mozilla as this is (kind of) a security hack...
    0
     
    LVL 4

    Author Comment

    by:LTY83
    heh sorry buddy was talkin about yer gf, i'm not sure if this works tho, in my browser it still shows the x, i have the newest version of ie as well
    0
     
    LVL 15

    Expert Comment

    by:justinbillig
    There is no way to accomplish what your asking, the closest thing you'll get is what sgalzin has already suggested
    0
     
    LVL 18

    Expert Comment

    by:arantius
    No you cannot do this.

    How would you like it for nefarious sites around the world to open windows you cannot close?  Plain and simple, especially with better browsers like Mozilla, the web page does not have this kind of control on the browser.

    If you want to control things like this, you need to write a native windows application, not a web page.  In the example posted, true, the window takes up the whole screen and moves the title bar (and thus the x button) off the screen, but you can still hit Alt-F4 to close it.
    0
     
    LVL 12

    Accepted Solution

    by:
    <script language="javascript">
    window.open('http://www.mydomain.com','popup', 'fullscreen= yes, left = 0, top =0, toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=yes, resizable=no');
    </script>
    0
     
    LVL 4

    Author Comment

    by:LTY83
    beautiful minichicken, u rock,
    0
     
    LVL 12

    Expert Comment

    by:minichicken
    cool :)
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
    In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
    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 the basics of jQuery including how to code hide show and toggles. 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…

    856 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

    16 Experts available now in Live!

    Get 1:1 Help Now