当前的浏览器在crome和mozilla中没有关闭 [英] current browser not close in crome and mozilla

查看:97
本文介绍了当前的浏览器在crome和mozilla中没有关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前浏览器未在crome和mozilla中关闭



这是我的javascript函数

mailid:dammu.suresh@gmail.com < br $>


函数closeWindows(){

window.open('';','_ parent','';

window.close();

}

current browser not close in crome and mozilla

this is my javascript function
mailid:dammu.suresh@gmail.com

function closeWindows() {
window.open('';,'_parent', '';
window.close();
}

推荐答案

你没有告诉windows对象要关闭的窗口的正确实例。这是一个合乎逻辑:当你使用 window 对象创建一个新窗口时,它将是一些在调用之前不存在的不同对象此外,立即关闭窗口没有任何意义。相反,使用

You are not telling windows object the proper instance of window to close. This is a different object. Be logical: when you use window object to create some new window, it will be some different object which did not exist before the call. Besides, closing window immediately would not make any sense. Instead, use
myWindow = window.open(/* ... */);
// use my window...

// ...

// in the point of code where the variable myWindow is visible, you can close it
myWindow.close();



请参阅: http://www.w3schools.com/jsref /met_win_close.asp [ ^ ]。< br $>


-SA


这篇关于当前的浏览器在crome和mozilla中没有关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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