惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

博客园 - 深渊野鱼

Framework7 链接重新回来之后,页面数据不重新获取,或者pageinit不重新执行 海关单一窗口程序出现网络/MQ问题后自动修复处理 win7 64bit 尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运行,将出现此问题 Commitment definition *N not valid for open XXX CPF4326 排查 PowerDesigner之逆向工程SQLServer注意事项 Paypal IPN 天敏SDK2500开发小计 Oracle在windows2003按星期几export的bat文件 - 深渊野鱼 - 博客园 OracleClient之诡异现象 虚拟主机权限之log4net Norton我错怪了你啊~~ 两个iFrame同时打开 - 深渊野鱼 - 博客园 如何向远程系统提交命令? RUNRMTCMD命令使用 OS/400与UNIX功能相似的部分命令 关于文件的ShareODP和USROPN 在5250上面实现复制粘贴 如何以某一关键字快速搜索AS/400 中的Message file 如何查看QTEMP的内容?可以查看别人的QTEMP的
IE JQuery 多Tab iframe 关闭Tab导致光标丢失
深渊野鱼 · 2013-06-07 · via 博客园 - 深渊野鱼

项目中使用DWZ作为jq框架,因为之前开发的东西都在传统的webform上,所以使用了大量的iframe,用其openExternal函数实现多Tab.

开发中还好,使用中发现,在ie下,如果一个Tab页下再打开一个Tab页,然后提交后调用closeCurrentTab的方式,结果光标就死活找不回来,只能用Tab键才能找回。

然后就开始茫茫的baidu,发现和我一样用法的人很少,哎,土人,跟不上时代。

终于,被我看到了一个和我一样用法的人,可惜人家不是用dwz,只是讲到这其实是IE的bug。

现象如下:

 框架内嵌iframe点击事件弹出层,弹出层又嵌套iframe,当弹出层iframe里面input获得光标后,删除弹出层(用的是jQuery.remove(),#.parentNode.removeChild(#)也测试不行),框架内嵌iframe的input获不得焦点了。

解决办法: 
先删除iframe,再删除弹出层。

因此,我们要修改dwz.navTab.js的_closeTab方法,然后IE就没bug了。 

 _closeTab: function (index, openTabid) {
        var iOpenIndex = this._indexTabId(openTabid);
        var $panel = this._getPanels().eq(iOpenIndex);
        $panel.find("iframe").remove();
        CollectGarbage();
        this._getTabs().eq(index).remove();  
        this._getPanels().eq(index).trigger(DWZ.eventType.pageClear).remove();
        this._getMoreLi().eq(index).remove();
        if (this._currentIndex >= index) this._currentIndex--;

        if (openTabid) {
            var openIndex = this._indexTabId(openTabid);
            if (openIndex > 0) this._currentIndex = openIndex;
        }

        this._init();
        this._scrollCurrent();
        this._reload(this._getTabs().eq(this._currentIndex));
    },