0

I want to open new tab on my example1.com if someone enter the example1.com, example2.com will opened in new tab but still the visitors should see example1.com is that bossible. At least i fount this code but it's require permission and when it's opened the visitors directly see example2.com

window.onload=function(){
  document.getElementById("myLink").click();
};
<a id="myLink" href="http://yahoo.com" target="_blank"> CLICK HERE NOW </a>
  • 1
    What it is you are planning to do with it? Can't you link to example2.com so the user can go there himself after he is done at example1.com? – Ivar Mar 24 '18 at 20:34
  • Nope it should be open directly without any clicking in new tab but the visitors should be stay in example1.com – Baran Yildirim Mar 24 '18 at 20:41
  • 1
    Opening a new tab without any user interaction is prohibited by (some) browsers, so for that you are out of luck. – Ivar Mar 24 '18 at 20:43

0 Answers0