JavaScript: Open Multiple Windows

by MythOfEchelon

HTML

<!DOCTYPE html> <!-- Basic HTML5 template. Make sure you set this up correctly for your personal needs -->

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        
        <script type="text/javascript">
            function newPopup(url1, url2, url3) {
                var prompt = confirm("Are you sure you wish to open a popup windows?");
                if (prompt == true){
                    window.open(url1); //New tab 1
                    window.open(url2); //New tab 2
            window.open(url3, "_blank", "height=600, width=1000"); //New window 1
                } else {
                    alert("You chose not to follow the link. No popups will be displayed.");
                }
                
                /* 
                   If you do not wish to have a pre-prompt box delete
                   everything inside the curly braces except for the
                   the line beginning with "window.open"
                */
            }
        </script>
    </head>
    
    <body>
        <!-- Simply replace "http://www.google.com" with your link -->
        
        <img src="http://www.clker.com/cliparts/9/1/5/2/119498475589498995button-red_benji_park_01.svg.med.png" style="cursor: pointer;" onClick="newPopup('http://www.google.com', 'http://www.twitter.com', 'http://en.wikipedia.org/wiki/Main_Page')" /> 
    </body>
</html>