0

looking for one link to open 2 or more pdfs. In my example, I used urls, hoping they both behave the same. I have clients that click the "required" link, so I need each requirement to open in a new window. I do not want new tabs, as the agent might not realize that there are still more requirements. I prefer the pdf's to open in a reader, so they can just fill it out and send back. I cant use pdfs on jsfiddle, that I know of, but the answers I did get will give me a great start. Thanks - I just realized our company has popups blocked, which is why only one link opens. No one has admin rights to override that, so looking for a work around. my jsfiddle:my attempts

<a href="#" onclick="window.open('http://stackoverflow.com/search?q=onclick+new+window','newerwindow','width=200');return false;window.open('http://stackoverflow.com/questions/14132122/open-url-in-new-window-with-javascript','125','width=600');return false;">windowOpen twice</a>

and another attempt:

<a href="http://www.w3schools.com" href="http://www.w3schools.com/tags/att_a_href.asp">2 hrefs?</a>

and another attempt:

<a href="http://www.microsoft.com" target="_blank" onclick="window.open('http://www.google.com'); window.open('http://www.yahoo.com','mywindowName');">href+2onClicks</a>

some of these codes come from this site, but do not work for me. I need it to work IE, (intranet)

Jim Schwetz
  • 105
  • 2
  • 12
  • 1
    Possible duplicate of [Open two windows onClick button javascript](http://stackoverflow.com/questions/12779771/open-two-windows-onclick-button-javascript) – scrappedcola Dec 15 '15 at 19:38
  • 1
    The issue lies with not naming your windows that you are trying to open. – scrappedcola Dec 15 '15 at 19:39
  • Maybe its just my browser then, I did try the link provided by scrappedcola, and it only opened the google with the 123, I did not get the second google with the abc. – Jim Schwetz Dec 15 '15 at 20:01
  • This does work to open 2 tabs, but since they are pdf's I would rather have them open as a new window or better yet an adobe reader. Thanks for the link, any ideas on a way without 2 tabs? – Jim Schwetz Dec 15 '15 at 20:15
  • tabs vs windows is a users personal settings preference and you generally don't have too much control over that. – scrappedcola Dec 15 '15 at 20:17

1 Answers1

1

try whit a function

 <a href="#" onclick="openMultiple();">2 hrefs?</a>

<script> 
  function openMultiple(){
     window.open('http://www.google.com');   
     window.open('http://www.yahoo.com','mywindowName');
  }
</script>
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107