javascript - Reference return by window.open() is Undefined in Edge browser -
the following code isn’t working edge though works other browsers.
function postlink(locn, trgt) { = document.createelement("a"); a.id = 'link'; a.targt = trgt; a.href = locn; var newwin = window.open(a); newwin.opener = newwin; }
<a onclick="postlink('http://www.google.com','_blank');return false;">clickme</a>
it gives newwin
undefined
. whereas, window.open()
works edge. explanation / appreciated.
from window.open()
docs:
syntax: window.open(url,name,specs,replace)
http://www.w3schools.com/jsref/met_win_open.asp
so, why not simplify code this:
<a onclick="window.open('http://www.google.com','_blank');">clickme</a>
Comments
Post a Comment