我想将js函数应用于我的确认按钮,我在页面外创建元素并使用ajax获取它们,因此我可以设置函数in-properties而不是$('#id')非常重要。确认()
这是我到目前为止:确认是弹出,但没有在确认时调用do_it函数。 (当我从控制台运行do_it时,它完美地运行)。
<button id="someid" class="btn" data-toggle="confirmation" data-onConfirm=do_it(1,2)>
ButtonText
</button>
我认为你使用了错误的属性值。它应该是“确认数据”。请参阅http://mistic100.github.io/Bootstrap-Confirmation/的链接