-1

I know this question has been "answered" multiple times, but nothing works in my case. I have tried with focus(),blur(). ect...I am using IE 11. Anyone have any idea? I want to open a new window, but keep focus on the original window....

 btn.addEventListener("click", function (ev) {


                        var url = "https://XXXX/XXXXX/XXXXXX/";

                        var newWin = window.open(url, "_blank");
                         window.focus();

                        ev.stopPropagation();
                    }, true); 
TheAsker
  • 55
  • 1
  • 9
  • Possible duplicate of [Open new window without focus on it](https://stackoverflow.com/questions/15133605/open-new-window-without-focus-on-it) – Lewis Dec 19 '18 at 11:20
  • ^ Just to add to that, the top answer does have a disclaimer that _your mileage may vary_, depending on how the user's browser handles this. – Lewis Dec 19 '18 at 11:21

1 Answers1

0

Try to refer example below may work for you.

Code in parent page.

<html>
<head>
<script language="JavaScript" type="text/javascript">
function openPopUP() {
  window.open('C:\\Users\\Administrator\\Desktop\\95.html','NewWin',
            'toolbar=no,status=no,width=350,height=135')
}
</script>
</head>
<body>
Original Page:<br>
<a href="javascript:openPopUP();">Click to open popup</a>
</body>
</html>

Code in child page.

<html>
<head>
<script>
function abc()
{
window.parent.opener.focus(); 
}


</script>
</head>
<body onLoad="abc()">
child page
</body>
</html>
Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19