我在InnovaStudio所见即所得编辑器(5.3)中有一个iframed“弹出式”窗口。它用于放置从导航到文本的链接。点击链接后,弹出窗口应该关闭。IE9和self.close()
此代码的工作,除了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();
});
弹出有它在调用ISWindow.objs['
UNIQUE_ID_STRING '].close();
上角自己的关闭按钮。我试图重写代码使用ISWindow
,但它表现出相同的行为,在所有浏览器中工作,但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();
}
}
});
您是否尝试过'window.close()' – Eduardo 2011-05-23 17:12:22