说明:在使用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);

最新文章

  1. python之常用内置函数
  2. 转载:Tomcat的JVM设置和连接数设置
  3. ENode 1.0 - 消息队列的设计思路
  4. [php入门] 3、WAMP中的集成MySQL相关基础操作
  5. Newton-Raphson算法简介及其R实现
  6. 继承多态绕点 Java篇
  7. CLSID {91493441-5A91-11CF-8700-00AA0060263B}错误
  8. Codeforces295A - Greg and Array(线段树的成段更新)
  9. [Ext JS 4] 实战之多选下拉单 (带checkbox)
  10. H5游戏见缝插针开发
  11. 设置webstorm缩写代码
  12. 从Cell类型转变成数据型
  13. Storage 002 电商数据库设计
  14. 七层协议&网络配置
  15. Python字符串格式化--format()方法
  16. css处理文本溢出
  17. bzoj4336 骑士的旅行 (树链剖分+multiset)
  18. delphi 大文件的读写 使用 MapviewOffile
  19. -webkit-min-device-pixel-ratio: 2是什么意思?
  20. 转载:【原译】Erlang构建和匹配二进制数据(Efficiency Guide)

热门文章

  1. Windows Server 2012 R2的安装(GUI桌面版本)
  2. maven 听视频笔记
  3. 2python脚本在window编辑后linux不能执行的问题
  4. 剑指offer-面试题58_1-翻转单词顺序-字符串
  5. 在Oracle中使用sqlload做数据迁移
  6. LeetCode 面试题52. 两个链表的第一个公共节点
  7. Linux ps和pstree命令
  8. 41.Python中加载静态文件
  9. export default和export的使用方法
  10. @RequestBody 和 @RequestParam(“test”) 的区别与联系