$('#refuse').on('click',function ()
{ layer.open({ type:1, area:['500px','300px'], content:$('#refusep').html(), shadeClose:true, btn:['确认','取消'], title:'审核拒绝', yes:function (index,layero)
{//index
为当前页面索引,layero 为当前页面的DOM,所以可以利用下面的方式获取 $.ajax({ url:'<%=contextPath%>/doctor/refuseApply', type:'post', dataType:'json', contentType:'application/json', data:
JSON.stringify({ id:$("#userId").val(),//获取的内容 reason:$(layero).find('textarea[name=reason]').val(), state:3 }) , success:function (data)
{ if (data.code=='200'){ layer.msg("审核成功"); layer.close(index); var index1
= parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 parent.layer.close(index1); //再执行关闭 } else layer.msg("审核失败"); }, error:function (data)
{ layer.msg("审核失败"); } }); }, cancel:function (index,layero)
{ layui.layer.close(index); } }); });
本文介绍了一个具体的案例,展示了如何通过jQuery与layer.js弹窗插件结合使用来实现一个带有确认与取消按钮的审核拒绝对话框,并通过AJAX发送审核拒绝的数据到服务器。

1万+

被折叠的 条评论
为什么被折叠?



