so*********@gmail.com wrote:
I have the following code in the event onbeforeunload
if ( typeof executingPostBack != 'undefined' && !executingPostBack )
event.returnValue = ""Warning: Modified data has not been saved."";
executingPostBack is a global variable.
I have another function for another event trying to access an object as
follows:
window.location.href = targetObj.href;
everything is OK, but it raises the "unspecified error" when I click
cancel in the popup confirmation window.
Not me: by my observations onbeforeupload handler works smoothly.
"Unspecified error" usually meand that you managed to twist the engine
totally for all 360deg, so it doesn't remember its name and the year
anymore :-)
This line make me suspitious:
window.location.href = targetObj.href;
-not by itself but because you call it "access an object". You are not
accessing an object, you are navigating away from the current page to
the targetObj.href location. If you have onbeforeunload confirmation
already pending for user interaction, add some more pending events...
add a bit of fantasy... I guess it is possible to produce "Unspecified
error". :-)
Could you narrow you problem to some minimum (but self-contained) code?