473,624 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onbeforeunload and a warning against loosing data

My4
Dear Sirs,

I want to give the user of my intranet a warning that if he uses the
explorers right corner 'X' to close the browser he looses his information. I
tried to prevent him from closing, or saving the data, but this seems
impossible, so a warning like 'the things you just typed must be entered
again probably' is good enough. I prefere onbeforeunload for onunload, which
is more standard, since the data that is soon to be lost, are still readable
on the screen.

I have two questions I cannot find the answer for using for example google:

1. To date, how standard is this event? The intranet users only use I.E. and
Netscape, and we can control the versions.

2. When is this event exactly fired? It seems that in I.E. it is not only
fired when using the corner "X" but also when I use a popup window to open a
calender in the form. Hence the effect was that I got a message: 'your data
is lost' when I opened a calender subwindow. Which is nonsence off course.
Can I check somehow where the event comes from? Or is there another clever
way to prevent this from happening

Kind Regards,

Jalisey Leyanis Escalona Alvarez
Aug 16 '05 #1
5 1867
Lee
My4 said:

Dear Sirs,

I want to give the user of my intranet a warning that if he uses the
explorers right corner 'X' to close the browser he looses his information.


To "loose" something means to release it, willingly.
Maybe you mean "lose"?

Aug 16 '05 #2
VK
> onbeforeunload and a warning against loosing data

By using a bit Google Groups search:

<http://groups-beta.google.com/group/comp.lang.javas cript/browse_frm/thread/9e071a9d1bfb53a f/afd6ed772e04fa6 d?lnk=st&q=onbe foreunload+grou p:comp.lang.jav ascript+author: VK&rnum=5&hl=en #afd6ed772e04fa 6d>

<http://groups-beta.google.com/group/comp.lang.javas cript/browse_frm/thread/2b000aaf0703810 a/0f741ad09b618ae 6?lnk=st&q=sorr y+life+group:co mp.lang.javascr ipt+author:VK&r num=1&hl=en#0f7 41ad09b618ae6>

<http://groups-beta.google.com/group/comp.lang.javas cript/browse_frm/thread/1b5b03d812669f7 8/9c50a94a1dcfd75 1?lnk=st&q=onbe foreunload+grou p:comp.lang.jav ascript+author: VK&rnum=1&hl=en #9c50a94a1dcfd7 51>

Please pay special attention to the last thread. In a good programming
environment you don't need to *nug your clients* that they gonna lose
their data. You have to ensure that *they will not loose their data*
neither in case of the window closure, nor in case the computer
shootdown, nor in any other. This goes beyond the scope of JavaScript
though. The first two threads explain the loosy (double "o" :) way to
handle the situation by staying withing the client-side scripting.

Aug 16 '05 #3
VK
> *they will not loose their data*

It's getting contagious :-)

*they will not LOSE their data*

Aug 16 '05 #4
My4

"Lee" <RE************ **@cox.net> schreef
To "loose" something means to release it, willingly.
Maybe you mean "lose"?


Are you a school teacher??

Please understand that English is not the first language of many posting on
the newsgroups and it;s annoying if you get corrected for each little
spelling mistake you make. More then that even, most people who know English
or do have English as a first language are not able to make one decent
sentence in another language themselves.

So if you want to play teacher, please translate my first message in Dutch,
Spanish, German and French, so I can make comments?
Aug 17 '05 #5
My4

"VK" <sc**********@y ahoo.com> schreef
By using a bit Google Groups search:


Thank you, I found that information really usefull
Aug 17 '05 #6

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

Similar topics

1
5671
by: rufus | last post by:
I have a function that checks whether the user is trying to navigate away from the page before saving all their data. I achieve this using the window.onbeforeunload javascript event. It fires when somone clicks on a link or button but not when someone changes the selected index of a dropdownlist or radio button. I tried registering the following script: RegisterOnSubmitStatement("submit", "confirmClose;") but it does not fire when a...
2
3506
by: Mozzie ³ | last post by:
Can 'onbeforeunload' (ie) be used to trigger a javascript? I can't find any info on how or if this is possible. Regards.
5
14916
by: Alistair Potts | last post by:
I'm assigning the onbeforeunload event a function thus (pseudo code): window.onbeforeunload=checkForm; function checkForm() { if(formChanged){ return 'You changed the form, are you sure?' } } As a conditional unload it works fine - the prompt only appears if you have changed form values. The issue is that Firefox/Mozilla comes up with a warning - "function checkForm does not always return a value".
6
23087
by: jennyw | last post by:
Hi, I'd like to use onbeforeunload to submit a form before leaving a page. This works in Firefox and IE. Safari, however, blithely ignores this. Does anyone know of a workaround for Safari? Or another way to do the same thing in Safari? (that is, intercept a request to leave the page). I tried Safari 2.02 on Tiger. Thanks!
4
11875
by: lilfos | last post by:
Hi there, I have an asp.net page with essentially a "don't forget to save" pop-up that is called when the user attempts to navigate away from the page. The user has the option to cancel and prevent the page from unloading. Since the form data is posted back to the server and saved during a normal postback, I don't need to prompt unless the user is actually going to a different URL or closing the browser. Currently, I get around this...
3
6223
by: Tony | last post by:
OK - I know the mantra, so let's be clear: I'm working on a web application that we want to be able to simply warn the user that they might lose data (or the current application state - it's .NET) if they navigate away from the page using the Back button. I was thinking of using onbeforeunload (which seems to work with IE, FF, and Netscape, but not Opera & Safari - that is acceptable). The problem is that if I define onbeforeunload, even...
4
10196
by: sowencheung | last post by:
the bug of onbeforeunload is so obvious! in IE 6 it will popup twice "sometimes" I am using the following code window.onbeforeunload = null; window.onbeforeunload = confirmExit; var executingPostBack = false;
2
6600
by: Jason | last post by:
Hello everyone, I have a chatroom. If someone leaves, I need to tell the server that person has left. Currently i catch window.onbeforeunload to check if the person tries to leave. I noticed that when I don't have a dialog popup asking if the person really wants to leave, my Ajax-request code doesn't always get sent to the server. Basically, the popup ensures my beforeunload code gets executed. Why is this? Also, when I try to stop the...
1
108713
Frinavale
by: Frinavale | last post by:
Introduction I've seen many questions asked about how to disable the browser's back button and in the past I've replied with "it's simply not possible". It's not a good idea to disable the back button anyways, if the user ventures away from your page then they wouldn't have this button at their disposal. The main reason people ask how to control or disable the back button is because they have a need to control sensitive (and/or) dynamic web...
0
8681
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7170
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.