admin管理员组文章数量:1435859
I have an iframed "pop-up" window in InnovaStudio WYSIWYG Editor (5.3). It is used to place a link from navigation into the text. Once a link is clicked, the pop-up should close.
This code works in all browsers except Internet Explorer 9:
$('#InternalLinkSelector').find('a').click(function(e) {
e.preventDefault();
$this = $(this);
(opener ? opener:openerWin).oUtil.obj.insertLink($this.attr('href'), $this.html(), null, null);
self.close();
});
The pop-up has it's own close button in the upper corner that calls ISWindow.objs['
UNIQUE_ID_STRING'].close();
. I tried rewriting the code to use ISWindow
, but it exhibits the same behavior, working in all browsers but IE9:
$('#InternalLinkSelector').find('a').click(function(e) {
e.preventDefault();
$this = $(this);
(opener?opener:openerWin).oUtil.obj.insertLink($this.attr('href'), $this.html(), null, null);
// Find the window object to close it
for (var i in top.ISWindow.objs) {
if ('function' == typeof top.ISWindow.objs[i].close) {
top.ISWindow.objs[i].close();
}
}
});
I have an iframed "pop-up" window in InnovaStudio WYSIWYG Editor (5.3). It is used to place a link from navigation into the text. Once a link is clicked, the pop-up should close.
This code works in all browsers except Internet Explorer 9:
$('#InternalLinkSelector').find('a').click(function(e) {
e.preventDefault();
$this = $(this);
(opener ? opener:openerWin).oUtil.obj.insertLink($this.attr('href'), $this.html(), null, null);
self.close();
});
The pop-up has it's own close button in the upper corner that calls ISWindow.objs['
UNIQUE_ID_STRING'].close();
. I tried rewriting the code to use ISWindow
, but it exhibits the same behavior, working in all browsers but IE9:
$('#InternalLinkSelector').find('a').click(function(e) {
e.preventDefault();
$this = $(this);
(opener?opener:openerWin).oUtil.obj.insertLink($this.attr('href'), $this.html(), null, null);
// Find the window object to close it
for (var i in top.ISWindow.objs) {
if ('function' == typeof top.ISWindow.objs[i].close) {
top.ISWindow.objs[i].close();
}
}
});
Share
Improve this question
asked May 23, 2011 at 17:01
SonnySonny
8,3467 gold badges65 silver badges137 bronze badges
1
-
have you tried just
window.close()
– Eduardo Commented May 23, 2011 at 17:12
2 Answers
Reset to default 2Try window.close()
instead of self.close()
I used console.log(self.close)
and traced it to these lines in InnovaStudio's istoolbar.js
code:
me.rt.frm.contentWindow.closeWin=function() {
me.close();
};
me.rt.frm.contentWindow.close=function() {
me.close();
};
So, thinking that IE9 may not be seeing the close()
for some reason, I changed my code to use closeWin()
:
$('#InternalLinkSelector').find('a').click(function(e) {
e.preventDefault();
$this = $(this);
(opener ? opener : openerWin).oUtil.obj.insertLink($this.attr('href'), $this.html(), null, null);
self.closeWin();
});
Now it works!
本文标签: javascriptIE9 and selfclose()Stack Overflow
版权声明:本文标题:javascript - IE9 and self.close() - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745658457a2668851.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论