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?
** Update Turns out the following code for the site's search is causing the issue. but why?
$("#searchresults li").live('click', function(e) {
if (e.target.nodeName != "a") {
window.location = $(this).find('a').attr('href');
}
});