Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: Re: Disable X button


Message #1 by "Robert Nyman" <robert.nyman@c...> on Wed, 25 Sep 2002 11:37:33 +0200
Well, it wasn't that hard (but I doubt if the user will like it...):

function warnUser(){
	event.returnValue =3D "Please don't surf away...";
}

<body onbeforeunload=3D"warnUser()">


/Robert



-----Ursprungligt meddelande-----
Fr=E5n: Rebane [mailto:raok@h...]
Skickat: den 25 september 2002 10:30
Till: javascript
=C4mne: [javascript] Re: Disable X button


> Is there any way to disable the "X" button used for closing the page?
>
> Likewise, can I stop a user from closing the page by double-clicking
> the
=3D
> icon in the top left hand corner?

In JavaScript can use onUnload function.

But someone have use something that:
http://www.cool-condoms.com/coolplayer.html
if someone know how it is done - it could be very useful.

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20


  Return to Index