BillKnow.com

Who Know ? Bill Know!

Archive for 七月 31st, 2010

31 七月
0Comments

‘return false;’ 和 ‘e.preventDefault();’的区别

原文地址:The difference between ‘return false;’ and ‘e.preventDefault();’

function() {
  return false;
}

// IS EQUAL TO

function(e) {
  e.preventDefault();
  e.stopPropagation();
}

return false阻止了事件的向上传递。

propegationdemo[1].png