Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

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
 
Share this answer
 
JavaScript
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
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900