JS 触发不同ifram控件,实现刷新,关闭标签(H+框架)
程序员文章站
2022-03-08 14:47:09
例: //前台页面事件处理模块var EventOperation = { Refresh: function (data_id) { var a = (window.top); var ele = a.document.querySelectorAll('[data-id="' + data_id ......
例:
//前台页面事件处理模块
var EventOperation = {
Refresh: function (data_id) {
var a = (window.top);
var ele = a.document.querySelectorAll('[data-id="' + data_id + '"]')[1];
ele.contentWindow.document.getElementById("btnSelect").click();
}
}
使用:
//刷新
EventOperation.Refresh("/StockManage/PurchaseList");
//关闭标签 自定义属性data-id 为(/StockManage/InsertPurEdit)
$(".J_menuTab[data-id='/StockManage/InsertPurEdit']", window.top.document).find(".fa.fa-times-circle").click();
//关闭当前标签
$(".J_menuTab.active", window.top.document).find(".fa.fa-times-circle").click();
注:data-id ifram是自定义属性