Closing Firefox Window or current Tab Using Java Script
How can i 开发者_如何学JAVAclose a Firefox Window or current Tab Using Java Script? I tried the following code, but it doesn't work....
window.close();
Please anyone help me!!!!
in JS, basically:
window.close();
or
self.close();
for more information, take a look at this and this.
You only can close windows you have opened yourself and in most browsers the user will be prompted and ask for permisson, at least if the window has already a history.
var myWindow= window.open(address, "title", "width=300,height=400,left=100,top=200");
myWindow.close();
精彩评论