My objective is to open two URLs in two tabs with just one click with a single link.
So far I have tried two javascript codes (found in this forum that attemps to open 3 URLs) and a jquery code.
It seems that Internet Explorer and Mozilla in their default settings allow this to happen. While in Chrome, I am getting the pop-up blocker. I know that it would be just a matter of allowing the pop-up to happen in chrome in order for the multiple links to open, but it would be a huge advantage for the experience I am trying to build, to have all browsers providing same user experience: one click, two URLs opened in two tabs.
Is there any workaround as of now that you might know that avoids getting the pop-up blocker in Chrome?
Below there are two the javascript codes and the jquery one that I have been testing. All of them have the same effect in chrome triggering, and succeed in Internet Explorer and Mozilla.
I thank you in advance.
JAVASCRIPT
<a href="#" target="_blank" onclick="window.open('http://google.com');
window.open('http://yahoo.com');" >Click to open Google and Yahoo</a>
<a href="http://bloggersentral.blogspot.com/" target="_blank"
onclick="window.open("http://www.tourism.gov.my/");
window.open("http://www.tic.kelantan.gov.my/");">This anchor opens three links in a single click</a>
JQUERY
<body>
<a href="" class="each">Click</a>
<script>
$('.each').click(function() {
var urlList = "http://www.google.com,http://www.yahoo.com"
$.each( urlList.split( "," ), function( index, item ) {
window.open( item, "_blank" )
});
})
</script>
</body>