Hi!
I am trying to implement a check for changes in the page content when the user attempts to leave a web page.
var changesHaveBeenMade = true;
function checkForChanges(event) {
if (changesHaveBeenMade) {
return "Changes in the content have been made.\n"+
"If you leave the page, the changes made will be lost.";
}
}
window.onbeforeunload = checkForChanges;
The above code works in both IE7 and FF2 if I click on OK and leave the page. It also works in FF2 if I click on Cancel and stay on the page.
However, I get a javascript error pointing to "jsfcljs" function generated by the JSF libraries if I click on Cancel in IE7.
I am using SNAPSHOT 3.2.2-20080708.043445.
Is there any way to avoid the javascript error and possible consequences?
Thank you!