如何从其他网站关闭一个网站 [英] How Do I Close one website from another website
本文介绍了如何从其他网站关闭一个网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有2个网站(X,Y),如果用户点击网站Y中的链接,网站X将在新标签中打开。我想从网站Y关闭网站X
解决方案
不,你不能。
您只能关闭自己创建的窗口/标签。也就是说,您无法以编程方式关闭用户创建的窗口/选项卡。
- Amy
var yWebSite = window .open( www.yWbsite.com',' _空白'跨度>);
// 以及从X网站点击链接
yWebSite.Close() ;
只有当你有处理程序时才能关闭标签。
-KR
I have 2 website (X,Y), website X opens in new tab if user clicks on a link present in Website Y. I want to Close website X from website Y
解决方案
No, You Cannot.
You can only close windows/tabs that you create yourself. That is, you cannot programmatically close a window/tab that the user creates.
--Amy
var yWebSite = window.open('www.yWbsite.com', '_blank'); // and on link click from X website yWebSite.Close();
You can close the tab only if you have handler for it.
-KR
这篇关于如何从其他网站关闭一个网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文