的javascript:window.close()的;不会关闭IE 8中的选项卡 [英] javascript:window.close(); doesn't close the tab in IE 8

查看:249
本文介绍了的javascript:window.close()的;不会关闭IE 8中的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它适用于Chrome,我认为它曾经在IE8中运行......但似乎没有。

It works in Chrome and I thought it used to work in IE8... but it doesn't seem to.

javascript:window.open('', '_self', ''); window.close();alert('test');

我得到的只是警告

基本上我正在尝试执行一个在浏览器中工作正常的函数作为 a 链接,但使用相同的代码在按钮上执行执行javascript,不起作用。

Basically i'm trying to execute a function which works fine in the browser as an a link, but using the same code in captivates "execute javascript" on a button, doesn't work.

然后我想我会用 javascript测试它: ...并且它不会关闭它。

Then I thought I would test it using javascript: in IE... and it doesn't close it ether.

是怎么回事?

它让我疯狂。

Whats going on?
It's driving me nuts.

推荐答案

我发现这有效

top.close();

来自浏览器地址栏

javascript:top.close();

这篇关于的javascript:window.close()的;不会关闭IE 8中的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆