Hi all,
I am using onbeforeunload to warn before leaving/closing a page using:-
window.onbeforeunload = confirmExit;
$msg = "Warning you are about to leave!";
function confirmExit(){return $msg;}
To stop links on the page showing the warning I am using:-
$("a").live("click", function () {
window.onbeforeunload = null;
});
This works for almost every link execept there is java menu (ddaccordion) which has menu header page-links that appear to open with this code when clicked:-
if (targetLink) //if this header is a link
setTimeout(function(){location=targetLink.href}, 200)
These links still trigger the warning and I need to stop them.
Can someone help with how I can prevent these menu header links from triggering from the warning, I need to set window.onbeforeunload = null when these links are clicked/opened??
TIA