Friday, 15 April 2011

javascript - clicking on a link with scroll wheel opens in a new tab but not when right-click + open new tab is performed -



javascript - clicking on a link with scroll wheel opens in a new tab but not when right-click + open new tab is performed -

i have link has onclick event calls function:

function popup(url){ window.open(url, ''); }

the link looks this:

<a href="javascript:void(popup('someurl'));">i'm link</a>

clicking on link should open pop-up window. opening in new tab should load page. thing is, page loads when scroll wheel clicked when right-click on link , take open in new tab, new tab blank (about:blank).

is there way create url load when right-click + open in new tab performed?

thank :)

you calling js function not link, it'll not possible open page in tab. can modify link as

<a href="javascript:;" onclick="javascript:popup('someurl')">i'm link</a>

or direct url href value accomplish goal.

javascript tabs popup href

No comments:

Post a Comment