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!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745658458a4638686.html
评论列表(0条)