假设我有以下代码:
模板
<a on-click='myfunc' href="#">Activate!</button>
javascript
var ractive = new Ractive({
el: output,
template: template
});
ractive.on( 'myfunc', function ( event ) {
alert( 'Hello world!' );
?????? --> how to prevent the next click event from the a href?
});
如何防止来自 a href 和 javascript 代码的下一次点击事件? 我试过 event.preventDefault();但该对象没有方法“preventDefault”
最佳答案
关于javascript - Ractive.js 防止事件代理上的默认事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19015586/