Am I totally missing what this is supposed to do? I expect that if I call stopPropagation() on an event, handlers for that event won't get triggered on ancestor elements, but the example below isn't working that way (in FireFox 3 at least)..
<script type="text/javascript">
$("input").live("click", function(event){
console.log("input click handler called")
event.stopPropagation()
});
$("body").live("click", function(event){
console.log("body was click handler called. event.isPropagationStopped() returns: " + event.isPropagationStopped());
})
</script>
...
<body>
<input type="text" >
</body>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…