1. 程式人生 > 實用技巧 >layui關閉iframe彈出層後重新整理父級頁面

layui關閉iframe彈出層後重新整理父級頁面

需求:點選按鈕->彈出iframe窗體->在iframe中的列表中選區需要的使用者條目->確認並關閉窗體->在父級窗體中顯示剛才選取的使用者(重新整理)。

layer.open({
                type: 2 //此處以iframe舉例
                , title: '名師列表'
                , area: ['800px', '600px']
                , shade: 0
                , maxmin: true
                , offset: 'auto'//
顯示座標-auto居中 , content:"{:url('admin/trainerlist')}" , btn: ['關閉'] , yes: function () { layer.closeAll(); // $(that).click(); } , zIndex: layer.zIndex //重點1 , success: function
(layero) { layer.setTop(layero); //重點2 }, end: function () { window.location.reload(); } });

關鍵點在與end:function.....,用window.location.reload();來重新整理頁面。

轉載:https://blog.csdn.net/blank__box/article/details/80944774?utm_source=blogxgwz0

----------------------------------------------------------------------------------------------------------------------------------------------------