473,545 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent How to prevent that Internet Explorer is closed

Hello

Is it possible with JavaScript to prevent that a User is closing the
Internet Explorer? Because it is important for me that the User pushes the
cancel Button of this webapplication how can i do this?

Thanks for your help
Jul 20 '05 #1
5 6914
"Clemens Ortwickler" <er*****@gmx.at > writes:
Is it possible with JavaScript to prevent that a User is closing the
Internet Explorer? Because it is important for me that the User pushes the
cancel Button of this webapplication how can i do this?


You can't. Redesign your application.
Will clicking your cancel button make a difference if the user isn't
connected to the internet any more?

You can *try* using the window.onunload handler. However, that also
triggers if the user tries to navigate away from the window, so it's
not your best guess. You should also expect the page to disappear,
so don't start anything that takes time in the handler. If really
desperate, you can open a new window (but expect every popup-blocker
out there to try to stop it).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Clemens Ortwickler wrote on 25 Nov 2003:
Hello

Is it possible with JavaScript to prevent that a User is closing
the Internet Explorer? Because it is important for me that the
User pushes the cancel Button of this webapplication how can i
do this?


I would really hope not: pop-up writers would have a field day with
that.

What you might be able to do (depending on what happens when the
cancellation occurs) is use the onunload intrinsic event to perform
whatever action the user is supposed to. If you're trying to write a
cookie or something similar, it should be fine. However, if it
involves navigating to another page, it won't help.

Mike

--
Michael Winter
M.******@blueyo nder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #3
You can't. Redesign your application.
Will clicking your cancel button make a difference if the user isn't
connected to the internet any more?


Thats very bad damn.... It is a local application so it doesn't matter. I
send HTTP Request to my Application and there should be a Request when you
click on the okay button the cancel button and when you close the Browser.
So if I use the unload method and i push the okay button i got 2 Requests
one for the unload handler and one for the okay button...

thats bad really bad but nevertheless thanks for your help!
Jul 20 '05 #4
Clemens Ortwickler wrote on 25 Nov 2003:
You can't. Redesign your application.
Will clicking your cancel button make a difference if the user
isn't connected to the internet any more?


Thats very bad damn.... It is a local application so it doesn't
matter. I send HTTP Request to my Application and there should
be a Request when you click on the okay button the cancel button
and when you close the Browser. So if I use the unload method
and i push the okay button i got 2 Requests one for the unload
handler and one for the okay button...

thats bad really bad but nevertheless thanks for your help!


You could have onclick handlers on the two buttons set a global that
the onunload event checks. If it's set, the onunload exits without
doing anything, and if not it does it's work. However, I'd take Mr
Nielsen's advice and find a new approach.

Mike

--
Michael Winter
M.******@blueyo nder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #5
Clemens Ortwickler wrote:
Hello

Is it possible with JavaScript to prevent that a User is closing the
Internet Explorer? Because it is important for me that the User pushes the
cancel Button of this webapplication how can i do this?

Thanks for your help


<strong>
Warning: Do not close this window! If you wish to
cancel the process, please click the "Cancel" button.
</strong>

Simple, and works with any browser.

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2375
by: milk-jam | last post by:
I'm trying to write a log which save each time internet explorer is opened or closed and all of the url which where visited? Any help is greatly appreciated.
3
4130
by: Simon | last post by:
Hi, I need to prevent Internet Explorer to save the page in history collection when it is in PostBack. To try do this I have put this code: protected override void OnLoad( EventArgs evt) { if (IsPostBack) Response.Cache.SetNoStore(); ..... base.OnLoad( evt);
6
2883
by: Sandy | last post by:
Hello - I have a little application that I would like to have an exit button on that closes my web application and closes Internet Explorer. What is the code that will do that? Any help will be greatly appreciated! --
3
3055
by: ckirchho | last post by:
Halo, I am trying to realize a two column layout basically like this: <html> <head> <style> leftCol { float: left; width: 15em; }
11
11595
by: Wendy | last post by:
Hello, I have a program that does the following: When a user clicks on a row in a VB.NET datagrid, it will open a web page in Internet Explorer (that corresponds to that item in the selected row in the datagrid). It will automatically print that web page, and then it will close the Internet Explorer window. I have code that works...
16
3776
by: danep | last post by:
Hi all, On my site I have a section of code that resembles the following: <p id="gear" style="display: none;"> <p>test</p> </p> This renders fine in Firefox (that is, nothing is displayed). However, in Internet Explorer, "test" is still printed. It appears
28
3565
by: Neo Geshel | last post by:
NOTE: PAST EXPERIENCE HAS SHOWN ME THAT MANY ON USENET FAIL TO READ ARTICLES PROPERLY PRIOR TO ANSWERING. I AM LOOKING FOR VERY SPECIFIC INFORMATION, THEREFORE PLEASE READ AND UNDERSTAND THOROUGHLY BEFORE RESPONDING; OR ASK QUESTIONS TO CLARIFY. I *WILL* APPRECIATE ANY CONSTRUCTIVE REPLY. Greetings! I am in the process of creating a...
4
4404
by: eschneider | last post by:
I get the following error when trying to browse the .asmx. I get the same thing when trying to add a reference. using .NET 2.0 There is no error message. Any ideas? Thanks,
2
3134
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.