I guess this might be a duplicate question but the existing answers were not of much help.
So, I have the below function which I have registered for onclick of a link:
function open_new()
{
if (win===null)
{
win=window.open("url","_blank");
}
else{
win.location.href="url";
win.focus();}
}
Dont worry much about the logic. In plain words, if user clicks on the link for the first time in the parent window, it open the url in a new window say window 2.
Now here the problem comes up -- > I move back to parent window and again I click on that link. It sets the href of window 2 , reloads it but does not focus. It will still remain on parent window.
Note: This works perfectly in chrome.