layer开发随笔

1、content发送请求返回一个页面在弹出层

layer.open({
        type: 2,
        content: "/information/province",
        shadeClose: true,
        area: ['620px', '260px'],
        btn: ['确定', '取消'],
        yes: function(index) {
            var body = layer.getChildFrame('body', index);
            var province = $(body.find("li").parent()).find(".filter_select_color").text().trim();
            $("#province").text(province);
            layer.close(index);
        }
    });
2、想要在提交时获取到选中的值,需要用这个layer.getChildFrame('body', index);获取到返回页面的body,然后通过body获取到标签值
原文地址:https://www.cnblogs.com/lk617-home/p/9713476.html