尝试将单击确认与 jQuery 绑定(以清理 JSF 页面中的代码)我了解 MyFaces 编写的 onclick 内联函数 (oamSubmitForm();) 在 jQuery click() 事件之前执行。之前可以做jQuery点击吗?
jQuery(".commandButtonConfirmDelete").click(function() {
var answer = confirm('Confirm Delete?');
return answer;
});
<h:commandLink styleClass="commandButtonConfirmDelete" />
<h:commandButton styleClass="commandButtonConfirmDelete" />