3

Is there a way to open a tab and then focus to parent without closing child? I utilize this code to open tab :

window.open('http://child.com/');

now how to return to parent window without closing any tab?

Updated : look at http://jsfiddle.net/3ZmvS/5/

document.getElementById("test").addEventListener("click", openNewBackgroundTab, false);

function openNewBackgroundTab(){
    var a = document.createElement("a");
    a.href = "http://www.google.com/";
    var evt = document.createEvent("MouseEvents");    
    evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, true, false, false, false, 0, null);
    a.dispatchEvent(evt);
}

this function does not work any more.

Mistalis
  • 17,793
  • 13
  • 73
  • 97

0 Answers0