$('#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); } }); });
The above is to pop up the page layer again based on a pop-up iframe layer, to obtain the content entered in textarea
The above is the detailed content of layer Get page layer (type:1) element method. For more information, please follow other related articles on the PHP Chinese website!