Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript IE9和self.close()_Javascript_Jquery - Fatal编程技术网

Javascript IE9和self.close()

Javascript IE9和self.close(),javascript,jquery,Javascript,Jquery,我在InnovaStudio所见即所得编辑器(5.3)中有一个iframed“弹出”窗口。它用于将导航链接放置到文本中。单击链接后,弹出窗口应关闭 此代码适用于除Internet Explorer 9以外的所有浏览器: $('#InternalLinkSelector').find('a').click(function(e) { e.preventDefault(); $this = $(this); (opener ? opener:openerWin).oUtil.

我在InnovaStudio所见即所得编辑器(5.3)中有一个iframed“弹出”窗口。它用于将导航链接放置到文本中。单击链接后,弹出窗口应关闭

此代码适用于除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()
而不是
self.close()

我使用了
console.log(self.close)
并在InnovaStudio的
istoolbar.js中跟踪到以下几行代码:

me.rt.frm.contentWindow.closeWin=function() {
    me.close();
};
me.rt.frm.contentWindow.close=function() {
    me.close();
};
因此,考虑到IE9可能由于某种原因没有看到
close()
,我将代码改为使用
closeWin()


现在它工作了

你试过了吗?
window.close()
window.close()
的行为方式与此相同。
$('#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();
});