Click to See Complete Forum and Search --> : Javascript and IE


cybervidyarthi
May 1st, 2002, 08:13 AM
Hello,

Kindly let me know this.

How can I disable the close button in the Internet Explorer Control box
(with minimize, maximize and close buttons) using Javascript?

Alternately, how can I minimize IE window by clicking a hyperlink?

Please give me a clue.

Thankyou,
Siva charan



Avis

mjxnjx
May 1st, 2002, 05:43 PM
Hello,


Your best approach would be to open a new window with all the toolbar & other settings turned off.

Here's an example of how someone else has done it:

settings='width='+ w + ',height='+ h + ',top=' + top + ',left=' + left + ',location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=yes,dependent=no';

ToolbarWindow=window.open('',myname,settings);



<i>You know that rating you've been holding onto? Now is a great time to use it!</I>

cybervidyarthi
May 3rd, 2002, 12:37 AM
hi whoever you are,

Thanks for the reply but it couldn't lessen my trouble. The prob is I can open the browser in full screen but I would like an option to minimize it onto the windows task bar. Is there any way for it, say by clicking on a hyperlink?

If not, I want to atleast disable the close button of the browser such that the user would not close the browser without logging out.

Hope this is clear enough.
Would be awfully pleased if you can help me out.
thankyou
bye

Avis

mjxnjx
May 3rd, 2002, 12:15 PM
You could simulate a minimize by doing the following:

<SCRIPT LANGUAGE="JavaScript">

function Minimize()
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;
}

function Maximize()
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</SCRIPT>

<A HREF="javascript:onClick=Minimize()">Minimize</A>
<A HREF="javascript:onClick=Maximize()">Maximize</A>



Unfortunately there is no full-proof way to prevent the user from closing the browser without forcing them to do something first (like logging out). For example, hitting CTRL-ALT-DELETE and ending the task is a simple way to bypass any forced logouts (or heck, even turning off the machine).

You might want to read from: http://www.jguru.com/faq/printablefaq.jsp?topic=JavaScript
Look for the title:
How can you logout a user (invalidate his Session) when a user directly closes his browser window?

Some people come up with ideas, but there's nothing really full-proof. The "timing out" might be the best approach to this. If there's no activity with that login in a given amount of time, automatically log them out.

Good luck!



<i>You know that rating you've been holding onto? Now is a great time to use it!</I>