javascript - Opening two urls with one click while avoiding popup blocker in Chrome -


my objective open 2 urls in 2 tabs 1 click single link.

so far have tried 2 javascript codes (found in forum attemps open 3 urls) , jquery code.

it seems internet explorer , mozilla in default settings allow happen. while in chrome, getting pop-up blocker. know matter of allowing pop-up happen in chrome in order multiple links open, huge advantage experience trying build, have browsers providing same user experience: 1 click, 2 urls opened in 2 tabs.

is there workaround of might know avoids getting pop-up blocker in chrome?

below there 2 javascript codes , jquery 1 have been testing. of them have same effect in chrome triggering, , succeed in internet explorer , mozilla.

i thank in advance.

javascript

 <a href="#" target="_blank" onclick="window.open('http://google.com');     window.open('http://yahoo.com');" >click open google , yahoo</a>     <a href="http://bloggersentral.blogspot.com/" target="_blank"        onclick="window.open(&quot;http://www.tourism.gov.my/&quot;);        window.open(&quot;http://www.tic.kelantan.gov.my/&quot;);">this anchor opens 3 links in 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> 

the user has manually allow popups because otherwise mean there whole lot of spam websites. no.

but here simple html code it

<a href="http://www.microsoft.com" target="_blank" onclick="window.open('http://www.google.com'); window.open('http://www.yahoo.com');">click here</a> 

you ask user disable it: how detect popup blocker in chrome?


Comments