鉴于以下功能:排除一个DIV中点击从window.onbeforeunload
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.";
}
};
我想办法从如果用户点击与ID的DIV一个链路上运行排除这种功能:
<div id="ignore me"><a href="">blah</a><a href="">blah</a><a href="">blah</a></div>
任何想法?
**更新 原因是网站搜索的以下代码导致该问题。但为什么?
$("#searchresults li").live('click', function(e) {
if (e.target.nodeName != "a") {
window.location = $(this).find('a').attr('href');
}
});
它是与生活,如果我更改绑定的问题消失。为什么? – AnApprentice 2010-04-18 18:31:39