Excluding clicks within a DIV from a window.onbeforeunload

Posted by nobosh on Stack Overflow See other posts from Stack Overflow or by nobosh
Published on 2010-04-18T02:35:50Z Indexed on 2010/04/18 2:43 UTC
Read the original article Hit count: 622

Given the following function:

window.onbeforeunload= function() {
    if (CKEDITOR.instances.stuff.getData().length > 0 && oktoquit == false) {
        return "You have unsaved changes. Click Cancel now, then 'Save' to save them. Click OK now to discard them.";
    }
};

I'd like a way to exclude this function from running if the user clicks a link in a div with an ID:

<div id="ignore me"><a href="">blah</a><a href="">blah</a><a href="">blah</a></div>

Any ideas?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about window