layer開發隨筆

 

一、content發送請求返回一個頁面在彈出層spa

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);
        }
    });
二、想要在提交時獲取到選中的值,須要用這個layer.getChildFrame('body', index);獲取到返回頁面的body,而後經過body獲取到標籤值
相關文章
相關標籤/搜索