i want to open a new tab on click but i want to previous tab always active, child tab not active by default
My code is-
<a onclick="window.open(URL); self.focus();>Click</a>
i want to open a new tab on click but i want to previous tab always active, child tab not active by default
My code is-
<a onclick="window.open(URL); self.focus();>Click</a>
Share
Improve this question
asked Jan 3, 2013 at 11:00
Ishan JainIshan Jain
8,19111 gold badges51 silver badges76 bronze badges
2 Answers
Reset to default 4This behaviour is up to the browser and can't be controlled by Javascript.
You can write code onload of the new window that gives focus back to the opener:
window.opener.focus();
notice that window.open opens a new window not a new tab, target=_blank
opens a new tab (optionally according to browser settings)
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744936409a4602052.html
评论列表(0条)