多个iframe,删除详情页时刷新同级iframe的table list
2024-08-28 18:19:27
说明:在使用iframe开发时,经常遇到多个iframe之间的操作。
下面就是一个需求:在一个iframe中关闭时,刷新指定的iframe;
添加需要刷新的标识reload=true
//添加npi2mp时,刷新NPI2MPTable
$(top.document).find("iframe").each(function () {
if ($(this).data("id") == "npi/showNPI2MPTable") {
$(this).attr("reload", "true");
return;
}
}); //删除时做同样的操作即可
然后再切换tab的操作中做判断是否需要刷新操作
//切换tab
function e() {
if (!$(this).hasClass("active")) {
var bRefresh = false; // 是否需要刷新
var tabName = $(this).text().trim();
// 解决128 & 131 issue ,新增NPI轉MP时候不用刷新页面 by robert
if (tabName == "新增NPI轉MP") {
bRefresh = false;
}
//切换tab时判断是否需要刷新
if (tabName == "NPI轉MP") {
$(top.document).find("iframe").each(function () {
if ($(this).data("id") == "npi/showNPI2MPTable") {
if ($(this).attr("reload")) {
bRefresh = true;
} else {
bRefresh = false;
}
$(this).removeAttr("reload");
return;
}
});
}
var k = $(this).data("id");
$(".J_mainContent .J_iframe").each(function () {
if ($(this).data("id") == k) {
//根据前面的判断,那些需要刷新
if (bRefresh) {
this.src = this.src; // 点击时刷新frame
}
$(this).show().siblings(".J_iframe").hide();
return false;
}
});
$(this).addClass("active").siblings(".J_menuTab").removeClass("active");
g(this);
}
}
$(".J_menuTabs").on("click", ".J_menuTab", e);
最新文章
- python之常用内置函数
- 转载:Tomcat的JVM设置和连接数设置
- ENode 1.0 - 消息队列的设计思路
- [php入门] 3、WAMP中的集成MySQL相关基础操作
- Newton-Raphson算法简介及其R实现
- 继承多态绕点 Java篇
- CLSID {91493441-5A91-11CF-8700-00AA0060263B}错误
- Codeforces295A - Greg and Array(线段树的成段更新)
- [Ext JS 4] 实战之多选下拉单 (带checkbox)
- H5游戏见缝插针开发
- 设置webstorm缩写代码
- 从Cell类型转变成数据型
- Storage 002 电商数据库设计
- 七层协议&;网络配置
- Python字符串格式化--format()方法
- css处理文本溢出
- bzoj4336 骑士的旅行 (树链剖分+multiset)
- delphi 大文件的读写 使用 MapviewOffile
- -webkit-min-device-pixel-ratio: 2是什么意思?
- 转载:【原译】Erlang构建和匹配二进制数据(Efficiency Guide)
热门文章
- Windows Server 2012 R2的安装(GUI桌面版本)
- maven 听视频笔记
- 2python脚本在window编辑后linux不能执行的问题
- 剑指offer-面试题58_1-翻转单词顺序-字符串
- 在Oracle中使用sqlload做数据迁移
- LeetCode 面试题52. 两个链表的第一个公共节点
- Linux ps和pstree命令
- 41.Python中加载静态文件
- export default和export的使用方法
- @RequestBody 和 @RequestParam(“test”) 的区别与联系