|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by andynic_nl in JScript, Safari Web Browser, Firefox Web Browser
The function shown below works perfectly for Inetenet Explorer 7 but not for Safari 3.2.2 or Firefax 3.5.3
Can anyone tell me what I need to add to get it to work for Safari and FireFox?
Thanks for you help
Andynic
PS: I'm a newbie in this area, and need would appreciate hand-holding here.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
|
function processOnBeforeUnload()
{
// The purpose of this function is to prevent the user from leaving a screen where changes
// could potentially be lost.
//
// At this writing, there is no provision for keeping track if an actual change was made.
// but better that than lose a number of changes.
//
// Each page that requires this protection (for example the main menu page (MM) does not, whereas
// manage galleries update confirm (UGC) does) the <body> tag must contain
// onBeforeUnload="processOnBeforeUnload()"
//
// On each of those pages, each button that can cause the user to leave the page, requires
// onClick=setButtonClicked("the button's name") which sets global variable GVbttnClkd
alert ("in processOnBeforeUnload");
var msg = "NOTA BENE:\\n" +
"If you have changed data on this page and do not want to lose the changes \\n" +
"then click \\"Cancel\\". \\n\\n" +
"Otherwise click \\"OK\\" to continue to the next page (i.e. continue the selected action).";
// Excluded buttons:
//
// For page UGC (see beginning of gfrm.cgi for the list of abbreviation meanings
if ( GVbttnClckd == "REback" ) { return; }
if ( GVbttnClckd == "UGCcancelUpdate1" ) { return; }
if ( GVbttnClckd == "UGCcancelUpdate2" ) { return; }
var event = event || window.event;
// the if part works exactly as it should for Internet Explorer 7
if (event)
{
event.returnValue = msg;
}
// ??? else // Need something here for Safari 3.2.2 and Firefox 3.5.3
// {
// ??????????
// confirm (msg); //puts message up but clicking either "OK" or "cancel" takes user to the next page
// return msg; // Does nothing.
// }
}
|
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625