Is开发者_开发技巧 it possible to close a browser window/tab with jQuery/Javascript?
window.close(); But this will only close the window opened by the javascript, otherwise a confirm box will appear
Yes you can close a window
window.close();//This will close the window
But you will get a confirm box while closing it. If the window in opened using javascript window.open() then you will not see this confirm dialog.
It is possible with the condition that the window/tab was opened via javascript. Otherwise, the user will be presented with a modal confirmation dialog stating that a script is attempting to close the window.
try
window.close()
but it works only on tabs you opened with javascript you can't close other tabs by using javascript or jquery
精彩评论